The first test shows that combineRangeChecks may choose to keep only two poison conditions.
And we cannot do simple arithmetic or logical and in guard.
The second test shows that even in simple test we can hoist a poison and even logical and does not help here.
Details
- Reviewers
mkazantsev reames apilipenko
Diff Detail
Event Timeline
I didn't quite get what's the problem with 2nd example and logical and, but the first example is more than enough to admit it's a bug.
llvm/test/Transforms/GuardWidening/posion.ll | ||
---|---|---|
74 | Consider a = 5, b = -1 In original program check in the loop b u< 10 protects us from the execution the guard in ok block on poison value - so no UB. |
nit: considers