Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit d19e547

Browse files
author
Sven Verdoolaege
committed
codegen_llvm.cc: toSInt: properly check for integer value
For non-integer values, the denominator may be zero, breaking the original check.
1 parent 9a9fcf5 commit d19e547

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/core/polyhedral/codegen_llvm.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ namespace {
7676
thread_local llvm::LLVMContext llvmCtx;
7777

7878
int64_t toSInt(isl::val v) {
79-
auto n = v.get_num_si();
80-
auto d = v.get_den_si();
81-
CHECK_EQ(n % d, 0);
82-
return n / d;
79+
CHECK(v.is_int());
80+
return v.get_num_si();
8381
}
8482

8583
llvm::Value* getLLVMConstantSignedInt64(int64_t v) {

0 commit comments

Comments
 (0)