[PATCH] D38581: [IRCE] Fix intersection between signed and unsigned ranges

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 21:27:52 PDT 2017


mkazantsev added inline comments.


================
Comment at: test/Transforms/IRCE/unsigned_comparisons_ult.ll:345
+  store i32 0, i32* %addr
+  %next = icmp ult i32 %idx.next, -100
+  br i1 %next, label %loop, label %exit
----------------
anna wrote:
> Am I right that because of the ult for the compare, -100 is actually UINT_MAX - 99, i.e. the 2's complement of the number. 
> So, the iteration space is within [0, SINT_MAX].
The iteration space here is `[0, UINT_MAX - 100)`. `SINT_MAX` is within the iteration range. The comment before test about `[100; -100)` is misleading, i'll fix it.


================
Comment at: test/Transforms/IRCE/unsigned_comparisons_ult.ll:360
+
+; CHECK:      test_09
+
----------------
anna wrote:
> Please add checks here as `CHECK-NOT` for pre and post loops.
On line 11, we had a check that IRCE didn't apply to the test:
`; CHECK-NOT: irce: in function test_09: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>`
But OK, I will add these asserts as well. :)


https://reviews.llvm.org/D38581





More information about the llvm-commits mailing list