http://llvm.org/bugs/show_bug.cgi?id=4722
Summary: GVN doesn't look through select for alloca
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Scalar Optimizations
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
This probably isn't GVN's fault directly. Somebody isn't peering through select
when checking whether a given value really is a select or not. This means we
miss this optimization:
%struct.X = type { i32 }
define void @_Z1fb(i1 %b) nounwind {
entry:
%x1 = alloca %struct.X, align 8
%x2 = alloca %struct.X, align 8
%iftmp.0.0 = select i1 %b, %struct.X* %x2, %struct.X* %x1
%tmp1 = getelementptr %struct.X* %iftmp.0.0, i64 0, i32 0
%tmp2 = load i32* %tmp1, align 8
%tmp3 = add i32 %tmp2, 1
store i32 %tmp3, i32* %tmp1, align 8
ret void
}
We need to make sure we limit the depth of any such search though, because it
can grow N^2 easily.
--
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