[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:28:12 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
----------------
mkazantsev wrote:
> 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.
`[0, UINT_MAX - 99)` fixed


https://reviews.llvm.org/D38581





More information about the llvm-commits mailing list