Diff Detail
Event Timeline
Hi Johannes,
this patch LGTM besides two minor comments:
- The LLVM language reference says "The range is allowed to wrap."
In case the lower bound is larger than the upper bound (e.g. [10, 5) we would add constraints p >= 10 && p < 5. However, this should rather be p >= 10 || p < 5.
- Add a comment that this change exploits LLVM's range metadata to the commit message
Sebastian pointed out that from a look at the commit message or the test case it is not immediately clear where the information about the bounded range of p is derived from. It would be nice to point this out in the commit message.
- Add a comment that this change exploits LLVM's range metadata to the commit message
Sebastian pointed out that from a look at the commit message or the test case it is not immediately clear where the information about the bounded range of p is derived from. It would be nice to point this out in the commit message.
I would like the comment to also be included in a comment in the
testcase close by the check line:
+; CHECK: [p_0] -> { : p_0 >= 0 and p_0 <= 255 }
pointing out that the constraint is deduced from the stmt using the
range !0 metadata:
+ %tmp = load i32* %p, align 4, !range !0
+!0 = !{ i32 0, i32 256 }
Thanks,
Sebastian