http://llvm.org/bugs/show_bug.cgi?id=2558
Summary: Argpromotion does not handle first class aggregates
Product: libraries
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Interprocedural Optimizations
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
Argumentpromotion does not currently promote first-class structs and arrays.
A testcase is as follows:
; This testcase makes sure that argpromotion promotes first class aggregates
; properly.
; RUN: llvm-as < %s | opt -argpromotion | llvm-dis > %t
; (These grep lines were not tested)
; RUN: cat %t | grep [EMAIL PROTECTED](i32 %.*, i32 %.*)}
; RUN: cat %t | grep [EMAIL PROTECTED](i32 %.*, i32 %.*)}
define internal i32 @sum({i32, i32} %A) {
%B = extractvalue {i32, i32} %A, 0
%C = extractvalue {i32, i32} %A, 0
%D = add i32 %B, %C
ret i32 %D
}
define internal i32 @sum2([2 x i32] %A) {
%B = extractvalue {i32, i32} %A, 0
%C = extractvalue {i32, i32} %A, 0
%D = add i32 %B, %C
ret i32 %D
}
define void @run(i32 %A, i32 %B) {
%C = insertvalue {i32, i32} undef, i32 %A, 0
%D = insertvalue {i32, i32} %C, i32 %B, 1
%E = call i32 @sum({i32, i32} %D);
%F = insertvalue [ 2 x i32 ] undef, i32 %A, 0
%G = insertvalue [ 2 x i32 ] %F, i32 %B, 1
%H = call i32 @sum({i32, i32} %D);
ret void
}
--
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