Diff Detail
Unit Tests
Time | Test | |
---|---|---|
710 ms | x64 debian > Polly.ScopInliner::simple-inline-loop.ll |
Event Timeline
Patch missing description.
I do not understand what this does, but i really strongly suspect you are trying to hide an UB in the original IR.
llvm/test/Transforms/InstCombine/range-check.ll | ||
---|---|---|
1 | Why was this deleted? |
llvm/test/Transforms/InstCombine/simplify-range-check.ll | ||
---|---|---|
5 | The current result is not a miscompile: https://alive2.llvm.org/ce/z/bZAccs |
Sorry for the absence of the description.
Actually, it is a runtime error. The simplify range check optimization will change (icmp slt x, 0) | (icmp sgt x, n) into icmp ugt x, n
Now, suppose the %0 is negative, Before optimizing, we will compare the argument with 0 to see whether the argument is less than 0, if so, we will finally return shl i32 %0, 0.
However, after optimizing, we will not have this comparison, and we will finally return shl i32 %0, %and. The problem is that %and is also driven from the argument, it can be undefined cause it is a shift operation that depends on the argument. So, after optimization, we will get an undefined result.
So, I guess that if both x and n in (icmp slt x, 0) | (icmp sgt x, n) are derived from the argument, then we should be conservative.
llvm/test/Transforms/InstCombine/range-check.ll | ||
---|---|---|
1 | all the variable optimized in the functions within this file are derived from arguments, so the IR won't get changed after this patch. |
Why was this deleted?