Commit 5b2201d
authored
Fixed lifetime marker causing unroll to fail (#4830)
Fixed a bug where enabling lifetime markers causes unroll to fail. Running instcombine before loop unroll may cause unroll to fail, because instcombine may rewrite expressions in a way that makes ScalarEvolutions unable to evaluate. This change replaces the instcombine with simplify-inst, which serves the same purpose as the instcombine, but leaves the expression easy for ScalarEvolutions to evaluate.
Also moved the original test for instcombine to a new folder with the new test, since instcombine pass is no longer being tested for that test.
The problematic expression rewrite was as follows:
```
limit = (non_const_int_value % 2) ? 1 : 2;
```
Instcombine rewrites it to
```
limit = 2 - (non_const_int_value & 1);
```
Which stumped ScalarEvolutions.1 parent 7d9567c commit 5b2201d
3 files changed
Lines changed: 36 additions & 1 deletion
File tree
- lib/Transforms/IPO
- tools/clang/test/HLSLFileCheck/passes/llvm/simplifyinst
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments