-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
Description
| Bugzilla Link | 1542 |
| Resolution | FIXED |
| Resolved on | Feb 22, 2010 12:46 |
| Version | trunk |
| OS | Linux |
| Blocks | #1692 |
| Attachments | testcase |
Extended Description
The attached is a miscompile was reduced by bugpoint. Run "opt
bugpoint-tooptimize.bc -loop-rotate -licm -lcssa" to reproduce.
I strongly recommend that anyone trying to visualize what's going on use opt
--print-cfg on the before and after.
The problem is in the optimization of the bb38 and bb32 loop. This sequence in
bb32 is clearly decrementing a value:
%tmp36 = load i32* %tmp5
%tmp37 = sub i32 %tmp36, 1
store i32 %tmp37, i32* %tmp5
however in the optimized code, the load of %tmp5 is hoisted into bb.nph outside
the loop (%tmp5.promoted).