http://llvm.org/bugs/show_bug.cgi?id=4420
Summary: Missed const propagation from condition of branch to phi
node at landing
Product: libraries
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Scalar Optimizations
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Created an attachment (id=3110)
--> (http://llvm.org/bugs/attachment.cgi?id=3110)
Assembly with missed optimization.
In the following assembly (which doesn't change under head's `opt -O3`:
declare i1 @ext()
define i1 @foo() {
entry:
%cond = tail call i1 @ext() ; <i1> [#uses=2]
br i1 %cond, label %bb1, label %bb2
bb1: ; preds = %entry
%cond2 = tail call i1 @ext() ; <i1> [#uses=1]
br i1 %cond2, label %bb3, label %bb2
bb2: ; preds = %bb1, %entry
%cond_merge = phi i1 [ %cond, %entry ], [ false, %bb1 ] ; <i1>
[#uses=1]
ret i1 %cond_merge
bb3: ; preds = %bb1
%res = tail call i1 @ext() ; <i1> [#uses=1]
ret i1 %res
}
%entry has "br i1 %cond, label %bb1, label %bb2". If this jumps to %bb2, we
know %cond was false. But %bb2 has "%cond_merge = phi i1 [ %cond, %entry ]...",
in which it could have inlined %cond as false.
--
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