http://llvm.org/bugs/show_bug.cgi?id=14854
Bug #: 14854
Summary: LICM pass doesn't hoist out insertvalue/extractvalue
instructions
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
LICM pass doesn't recognize insertvalue/extractvalue instructions as hoistable
and a possible optimization is missed.
For example, compilation of this code using opt -basicaa -licm doesn't change
anything even though the
%out = extractvalue { i32*, i32 } %0, 1
can be moved outside the loop:
define internal i32 @test(i32 %i, { i32*, i32 }* noalias nocapture byval %e) {
entry:
%0 = load { i32*, i32 }* %e, align 4, !invariant.load !0
br label %tailrecurse
tailrecurse: ; preds = %then, %entry
%i.tr = phi i32 [ %i, %entry ], [ %2, %then ]
%out = extractvalue { i32*, i32 } %0, 1
%1 = icmp sgt i32 %out, %i.tr
br i1 %1, label %then, label %ifend
then: ; preds = %tailrecurse
%2 = add i32 %i.tr, 1
br label %tailrecurse
ifend: ; preds = %tailrecurse
ret i32 0
}
!0 = metadata !{}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs