llvm-project
llvm-project copied to clipboard
[Loop Reduce] Assertion failure due to invalid canonicalization for formula
| Bugzilla Link | 33077 |
| Resolution | FIXED |
| Resolved on | May 18, 2017 12:22 |
| Version | trunk |
| OS | All |
| Attachments | Input IR for loop-reduce |
| CC | @qcolombet |
Extended Description
Testcase causing an assertion failure in formula canonicalization in LSR. This was added in patch: https://reviews.llvm.org/rL295884
Assertion failed: (F.isCanonical(L) && "Invalid canonical representation"), function InsertFormula, Transforms/Scalar/LoopStrengthReduce.cpp, line 1431
Added a test case reduced using bugpoint. By reverting rL295884, the test case passes.
Reproduce: opt -loop-reduce bugpoint.ll
Wei fixed it in r303361
I'm guessing we are missing a call to Canonicalize. I leave the exact investigation to Wei.