Details
Details
Diff Detail
Diff Detail
Unit Tests
Unit Tests
Event Timeline
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | ||
---|---|---|
316–317 | This whole code looks like a mess. It's really hard to follow what exactly is it doing. I guess your change should be the same for UGE, but from this code structure it's really hard to follow on how it's gonna happen. I propose the following NFC refactoring:
After that, your change would be: when we have IV <= RHS, check that RHS + 1 doesn not overflow (signed or unsigned overflow - depending on what predicate is used), and if yes, add 1 to RHS. This, at least, would be easier to understand. | |
321 | Name L is almost exclusively used for loops, call this LHSS. |
Comment Actions
I propose the following NFC refactoring
Thanks, done: https://reviews.llvm.org/D148720
This whole code looks like a mess. It's really hard to follow what exactly is it doing. I guess your change should be the same for UGE, but from this code structure it's really hard to follow on how it's gonna happen.
I propose the following NFC refactoring:
After that, your change would be: when we have IV <= RHS, check that RHS + 1 doesn not overflow (signed or unsigned overflow - depending on what predicate is used), and if yes, add 1 to RHS.
This, at least, would be easier to understand.