================
@@ -2899,11 +2899,18 @@ class IteratorInfo {
upperBounds[d] = ub;
steps[d] = st;
- // trips = ((ub - lb) / step) + 1 (inclusive ub, assume positive step)
- llvm::Value *diff = builder.CreateSub(ub, lb);
- llvm::Value *div = builder.CreateSDiv(diff, st);
- trips[d] = builder.CreateAdd(
- div, llvm::ConstantInt::get(builder.getInt64Ty(), 1));
+ // Use a direction-aware count so an empty range contributes no entries.
+ // Widen before subtracting bounds: valid i64 endpoints can have a span
+ // that does not fit in signed i64.
+ llvm::Type *countTy = builder.getIntNTy(65);
----------------
MattPD wrote:
The `integer(16)` reproducer now produces three dependences at the expected
locations: `a(1)`, `a(2)`, and `a(3)`.
https://github.com/llvm/llvm-project/pull/227454
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits