http://llvm.org/bugs/show_bug.cgi?id=13590
Bug #: 13590
Summary: Select condition not propagated to values
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
The following code is not optimized
define i32 @f(i1 %X) {
entry:
%ext = zext i1 %X to i32
%res = select i1 %X, i32 %ext, i32 1
ret i32 %res
}
but the equivalent one using phis is:
define i32 @f(i1 %X) {
entry:
br i1 %X, label %truel, label %falsel
truel:
%ext = zext i1 %X to i32
br label %end
falsel:
br label %end
end:
%res = phi i32 [ %ext, %truel], [ 1, %falsel]
ret i32 %res
}
is converted by gvn into
define i32 @f(i1 %X) {
entry:
br i1 %X, label %truel, label %falsel
truel: ; preds = %entry
br label %end
falsel: ; preds = %entry
br label %end
end: ; preds = %falsel, %truel
ret i32 1
}
--
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