Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC][AIX] Enable passing byval formal arguments in multiple regi…
…sters. Any or all the argument registers can be used to pass a byval formal argument, with the limitation that the argument must fit in the available registers (ie: is not split between registers and stack). Differential Revision: https://reviews.llvm.org/D76902
- Loading branch information
Showing
3 changed files
with
192 additions
and
34 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,20 @@ | ||
; RUN: not --crash llc -mtriple powerpc-ibm-aix-xcoff -stop-after=machine-cp \ | ||
; RUN: -mcpu=pwr4 -mattr=-altivec -verify-machineinstrs 2>&1 < %s | FileCheck %s | ||
|
||
; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -stop-after=machine-cp \ | ||
; RUN: -mcpu=pwr4 -mattr=-altivec -verify-machineinstrs 2>&1 < %s | FileCheck %s | ||
|
||
; CHECK: LLVM ERROR: Pass-by-value arguments are only supported in registers. | ||
|
||
%struct.Spill = type { [12 x i64 ] } | ||
@GS = external global %struct.Spill, align 4 | ||
|
||
define i64 @test(%struct.Spill* byval(%struct.Spill) align 4 %s) { | ||
entry: | ||
%arrayidx_a = getelementptr inbounds %struct.Spill, %struct.Spill* %s, i32 0, i32 0, i32 2 | ||
%arrayidx_b = getelementptr inbounds %struct.Spill, %struct.Spill* %s, i32 0, i32 0, i32 10 | ||
%a = load i64, i64* %arrayidx_a | ||
%b = load i64, i64* %arrayidx_b | ||
%add = add i64 %a, %b | ||
ret i64 %add | ||
} |
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