mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-18 20:18:12 +00:00
![Max Kazantsev](/assets/img/avatar_default.png)
When iterating through loop for (int i = INT_MAX; i > 0; i--) We fail to generate the pre-loop for it. It happens because we use the overflown value in a comparison predicate when identifying whether or not we need it. In old logic, we used SLE predicate against Greatest value which exceeds all seen values of the IV and might be overflown. Now we use the GreatestSeen value of this IV with SLT predicate. Also added a test that ensures that a pre-loop is generated for such loops. Differential Revision: https://reviews.llvm.org/D35347 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308001 91177308-0d34-0410-b5e6-96231b3b80d8