-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIX] Refactor AIX Call Lowering to use CCState. NFCI.
This patch reworks the AIX call lowering to use CCState. Some defensive errors are added in this patch to protect from emitting bad code for calling convention logic that has not been implemented by design. The use of CCState follows the precedent of other targets and enables the reuse of calling convention logic in LowerFormalArguments, which will be rewritten to also use CCState in a late patch. Patch by Chris Bowler. Differential Revision: https://reviews.llvm.org/D69101
- Loading branch information
Showing
5 changed files
with
176 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; RUN: not llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
|
||
%struct.S = type { i32, i32 } | ||
|
||
define void @bar() { | ||
entry: | ||
%s1 = alloca %struct.S, align 4 | ||
%agg.tmp = alloca %struct.S, align 4 | ||
call void @foo(%struct.S* byval(%struct.S) align 4 %agg.tmp) | ||
ret void | ||
} | ||
|
||
declare void @foo(%struct.S* byval(%struct.S) align 4) | ||
|
||
; CHECK: LLVM ERROR: Passing structure by value is unimplemented. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: not llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
|
||
define i8* @nest_receiver(i8* nest %arg) nounwind { | ||
ret i8* %arg | ||
} | ||
|
||
define i8* @nest_caller(i8* %arg) nounwind { | ||
%result = call i8* @nest_receiver(i8* nest %arg) | ||
ret i8* %result | ||
} | ||
|
||
; CHECK: LLVM ERROR: Nest arguments are unimplemented. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; RUN: not llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
|
||
%struct.S = type { i32 } | ||
|
||
define void @barv() { | ||
entry: | ||
%tmp = alloca %struct.S, align 4 | ||
call void @foo(%struct.S* sret %tmp) | ||
ret void | ||
} | ||
|
||
declare void @foo(%struct.S* sret) | ||
|
||
; CHECK: LLVM ERROR: Struct return arguments are unimplemented. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; RUN: not llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s | ||
|
||
define void @bar() { | ||
entry: | ||
call void @foo(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9) | ||
ret void | ||
} | ||
|
||
declare void @foo(i32, i32, i32, i32, i32, i32, i32, i32, i32) | ||
|
||
; CHECK: LLVM ERROR: Handling of placing parameters on the stack is unimplemented! |