[LLVMbugs] [Bug 1345] NEW: instcombine should recover more type info
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon Apr 23 10:08:42 PDT 2007
http://llvm.org/bugs/show_bug.cgi?id=1345
Summary: instcombine should recover more type info
Product: libraries
Version: trunk
Platform: Macintosh
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Scalar Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: sabre at nondot.org
Instcombine should eliminate the two bitcasts in this example:
define i8* @test(i8* %v) {
%A = alloca [4 x i8*], align 16 ; <[4 x i8*]*> [#uses=3]
%B = getelementptr [4 x i8*]* %A, i32 0, i32 0 ; <i8**> [#uses=1]
store i8* null, i8** %B
%C = bitcast [4 x i8*]* %A to { [16 x i8] }* ; <{ [16 x i8] }*> [#uses=1]
%D = getelementptr { [16 x i8] }* %C, i32 0, i32 0, i32 8 ; <i8*> [#uses=1]
%E = bitcast i8* %D to i8** ; <i8**> [#uses=1]
store i8* %v, i8** %E
%F = getelementptr [4 x i8*]* %A, i32 0, i32 2 ; <i8**> [#uses=1]
%G = load i8** %F ; <i8*> [#uses=1]
ret i8* %G
}
Doing so would allow SROA to eliminate the alloca, turning the function into an identity function.
-Chris
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list