Closed
Description
llvm commit: e76b257
Reproduce with:
opt -passes="loop-unroll,loop-mssa(licm,indvars)" -unroll-count=4 bbi-95405.ll -S -o -
The input function returns 32768, but after running the passes as above we get
define i16 @foo() {
entry:
br label %loop
loop: ; preds = %loop, %entry
br i1 false, label %loop, label %end, !llvm.loop !0
end: ; preds = %loop
ret i16 8192
}
!0 = distinct !{!0, !1}
!1 = !{!"llvm.loop.unroll.disable"}
So now the function returns 8192 instead.
If I extract the IR after loop-unroll or licm and run the rest of the passes instead I get the correct result.