mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
[SystemZ] Allocate a second register scavenging slot
This is another prerequisite for frame-to-frame MVC copies. I'll commit the patch that makes use of the slot separately. The downside of trying to test many corner cases with each of the available addressing modes is that a fair few tests need to account for the new frame layout. I do still think it's useful to have all these tests though, since it's something that wouldn't get much coverage otherwise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185698 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61de142984
commit
47734db936
@ -270,10 +270,14 @@ processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||
MachineFrameInfo *MFFrame = MF.getFrameInfo();
|
||||
uint64_t MaxReach = (MFFrame->estimateStackSize(MF) +
|
||||
SystemZMC::CallFrameSize * 2);
|
||||
if (!isUInt<12>(MaxReach))
|
||||
// We may need a register scavenging slot if some parts of the frame
|
||||
if (!isUInt<12>(MaxReach)) {
|
||||
// We may need register scavenging slots if some parts of the frame
|
||||
// are outside the reach of an unsigned 12-bit displacement.
|
||||
// Create 2 for the case where both addresses in an MVC are
|
||||
// out of range.
|
||||
RS->addScavengingFrameIndex(MFFrame->CreateStackObject(8, 8, false));
|
||||
RS->addScavengingFrameIndex(MFFrame->CreateStackObject(8, 8, false));
|
||||
}
|
||||
}
|
||||
|
||||
// Emit instructions before MBBI (in MBB) to add NumBytes to Reg.
|
||||
|
@ -20,18 +20,18 @@ define void @f1(i64 %x) {
|
||||
|
||||
; Check frames of size 32760, which is the largest size that can be both
|
||||
; allocated and freed using AGHI. This size is big enough to require
|
||||
; an emergency spill slot at 160(%r15), for instructions with unsigned
|
||||
; two emergency spill slots at 160(%r15), for instructions with unsigned
|
||||
; 12-bit offsets that end up being out of range. Fill the remaining
|
||||
; 32760 - 168 bytes by allocating (32760 - 168) / 8 = 4074 doublewords.
|
||||
; 32760 - 176 bytes by allocating (32760 - 176) / 8 = 4073 doublewords.
|
||||
define void @f2(i64 %x) {
|
||||
; CHECK: f2:
|
||||
; CHECK: aghi %r15, -32760
|
||||
; CHECK: .cfi_def_cfa_offset 32920
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: aghi %r15, 32760
|
||||
; CHECK: br %r14
|
||||
%y = alloca [4074 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4074 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [4073 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4073 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -42,11 +42,11 @@ define void @f3(i64 %x) {
|
||||
; CHECK: f3:
|
||||
; CHECK: aghi %r15, -32768
|
||||
; CHECK: .cfi_def_cfa_offset 32928
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: agfi %r15, 32768
|
||||
; CHECK: br %r14
|
||||
%y = alloca [4075 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4075 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [4074 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4074 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -57,11 +57,11 @@ define void @f4(i64 %x) {
|
||||
; CHECK: f4:
|
||||
; CHECK: agfi %r15, -32776
|
||||
; CHECK: .cfi_def_cfa_offset 32936
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: agfi %r15, 32776
|
||||
; CHECK: br %r14
|
||||
%y = alloca [4076 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4076 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [4075 x i64], align 8
|
||||
%ptr = getelementptr inbounds [4075 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -71,11 +71,11 @@ define void @f4(i64 %x) {
|
||||
define void @f5(i64 %x) {
|
||||
; CHECK: f5:
|
||||
; CHECK: agfi %r15, -2147483640
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: agfi %r15, 2147483640
|
||||
; CHECK: br %r14
|
||||
%y = alloca [268435434 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435434 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [268435433 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435433 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -85,12 +85,12 @@ define void @f5(i64 %x) {
|
||||
define void @f6(i64 %x) {
|
||||
; CHECK: f6:
|
||||
; CHECK: agfi %r15, -2147483648
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: agfi %r15, 2147483640
|
||||
; CHECK: aghi %r15, 8
|
||||
; CHECK: br %r14
|
||||
%y = alloca [268435435 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435435 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [268435434 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435434 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -101,12 +101,12 @@ define void @f7(i64 %x) {
|
||||
; CHECK: f7:
|
||||
; CHECK: agfi %r15, -2147483648
|
||||
; CHECK: aghi %r15, -8
|
||||
; CHECK: stg %r2, 168(%r15)
|
||||
; CHECK: stg %r2, 176(%r15)
|
||||
; CHECK: agfi %r15, 2147483640
|
||||
; CHECK: aghi %r15, 16
|
||||
; CHECK: br %r14
|
||||
%y = alloca [268435436 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435436 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [268435435 x i64], align 8
|
||||
%ptr = getelementptr inbounds [268435435 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
|
@ -5,9 +5,9 @@
|
||||
|
||||
; Test a frame size that requires some FPRs to be saved and loaded using
|
||||
; the 20-bit STDY and LDY while others can use the 12-bit STD and LD.
|
||||
; The frame is big enough to require an emergency spill slot at 160(%r15),
|
||||
; The frame is big enough to require two emergency spill slots at 160(%r15),
|
||||
; as well as the 8 FPR save slots. Get a frame of size 4128 by allocating
|
||||
; (4128 - 168 - 8 * 8) / 8 = 487 extra doublewords.
|
||||
; (4128 - 176 - 8 * 8) / 8 = 486 extra doublewords.
|
||||
define void @f1(double *%ptr, i64 %x) {
|
||||
; CHECK-NOFP: f1:
|
||||
; CHECK-NOFP: aghi %r15, -4128
|
||||
@ -65,8 +65,8 @@ define void @f1(double *%ptr, i64 %x) {
|
||||
; CHECK-FP: ld %f15, 4064(%r11)
|
||||
; CHECK-FP: lmg %r11, %r15, 4216(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%y = alloca [487 x i64], align 8
|
||||
%elem = getelementptr inbounds [487 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [486 x i64], align 8
|
||||
%elem = getelementptr inbounds [486 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %elem
|
||||
%l0 = load volatile double *%ptr
|
||||
%l1 = load volatile double *%ptr
|
||||
@ -127,7 +127,7 @@ define void @f1(double *%ptr, i64 %x) {
|
||||
; good optimisation but is really a different test.
|
||||
;
|
||||
; As above, get a frame of size 524320 by allocating
|
||||
; (524320 - 168 - 8 * 8) / 8 = 65511 extra doublewords.
|
||||
; (524320 - 176 - 8 * 8) / 8 = 65510 extra doublewords.
|
||||
define void @f2(double *%ptr, i64 %x) {
|
||||
; CHECK-NOFP: f2:
|
||||
; CHECK-NOFP: agfi %r15, -524320
|
||||
@ -194,8 +194,8 @@ define void @f2(double *%ptr, i64 %x) {
|
||||
; CHECK-FP: aghi %r11, 128
|
||||
; CHECK-FP: lmg %r11, %r15, 524280(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%y = alloca [65511 x i64], align 8
|
||||
%elem = getelementptr inbounds [65511 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65510 x i64], align 8
|
||||
%elem = getelementptr inbounds [65510 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %elem
|
||||
%l0 = load volatile double *%ptr
|
||||
%l1 = load volatile double *%ptr
|
||||
|
@ -3,8 +3,8 @@
|
||||
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
||||
|
||||
; This is the largest frame size that can use a plain LMG for %r6 and above.
|
||||
; It is big enough to require an emergency spill slot at 160(%r15),
|
||||
; so get a frame of size 524232 by allocating (524232 - 168) / 8 = 65508
|
||||
; It is big enough to require two emergency spill slots at 160(%r15),
|
||||
; so get a frame of size 524232 by allocating (524232 - 176) / 8 = 65507
|
||||
; extra doublewords.
|
||||
define void @f1(i32 *%ptr, i64 %x) {
|
||||
; CHECK: f1:
|
||||
@ -64,15 +64,15 @@ define void @f1(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add12, i32 *%ptr
|
||||
store volatile i32 %add13, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [65508 x i64], align 8
|
||||
%entry = getelementptr inbounds [65508 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65507 x i64], align 8
|
||||
%entry = getelementptr inbounds [65507 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; This is the largest frame size that can use a plain LMG for %r14 and above
|
||||
; It is big enough to require an emergency spill slot at 160(%r15),
|
||||
; so get a frame of size 524168 by allocating (524168 - 168) / 8 = 65500
|
||||
; It is big enough to require two emergency spill slots at 160(%r15),
|
||||
; so get a frame of size 524168 by allocating (524168 - 176) / 8 = 65499
|
||||
; extra doublewords.
|
||||
define void @f2(i32 *%ptr, i64 %x) {
|
||||
; CHECK: f2:
|
||||
@ -100,8 +100,8 @@ define void @f2(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add4, i32 *%ptr
|
||||
store volatile i32 %add5, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [65500 x i64], align 8
|
||||
%entry = getelementptr inbounds [65500 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65499 x i64], align 8
|
||||
%entry = getelementptr inbounds [65499 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
@ -167,8 +167,8 @@ define void @f3(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add12, i32 *%ptr
|
||||
store volatile i32 %add13, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [65509 x i64], align 8
|
||||
%entry = getelementptr inbounds [65509 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65508 x i64], align 8
|
||||
%entry = getelementptr inbounds [65508 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
@ -202,8 +202,8 @@ define void @f4(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add4, i32 *%ptr
|
||||
store volatile i32 %add5, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [65501 x i64], align 8
|
||||
%entry = getelementptr inbounds [65501 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65500 x i64], align 8
|
||||
%entry = getelementptr inbounds [65500 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
@ -236,8 +236,8 @@ define void @f5(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add4, i32 *%ptr
|
||||
store volatile i32 %add5, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [69595 x i64], align 8
|
||||
%entry = getelementptr inbounds [69595 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [69594 x i64], align 8
|
||||
%entry = getelementptr inbounds [69594 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
@ -270,8 +270,8 @@ define void @f6(i32 *%ptr, i64 %x) {
|
||||
store volatile i32 %add4, i32 *%ptr
|
||||
store volatile i32 %add5, i32 *%ptr
|
||||
store volatile i32 %add14, i32 *%ptr
|
||||
%y = alloca [69596 x i64], align 8
|
||||
%entry = getelementptr inbounds [69596 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [69595 x i64], align 8
|
||||
%entry = getelementptr inbounds [69595 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %entry
|
||||
ret void
|
||||
}
|
||||
|
@ -107,9 +107,9 @@ define void @f3(i32 *%ptr) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; The largest frame for which the LMG is in range. This frame has an
|
||||
; emergency spill slot at 160(%r11), so create a frame of size 524192
|
||||
; by allocating (524192 - 168) / 8 = 65503 doublewords.
|
||||
; The largest frame for which the LMG is in range. This frame has two
|
||||
; emergency spill slots at 160(%r11), so create a frame of size 524192
|
||||
; by allocating (524192 - 176) / 8 = 65502 doublewords.
|
||||
define void @f4(i64 %x) {
|
||||
; CHECK: f4:
|
||||
; CHECK: stmg %r11, %r15, 88(%r15)
|
||||
@ -119,12 +119,12 @@ define void @f4(i64 %x) {
|
||||
; CHECK: .cfi_def_cfa_offset 524352
|
||||
; CHECK: lgr %r11, %r15
|
||||
; CHECK: .cfi_def_cfa_register %r11
|
||||
; CHECK: stg %r2, 168(%r11)
|
||||
; CHECK: stg %r2, 176(%r11)
|
||||
; CHECK-NOT: ag
|
||||
; CHECK: lmg %r11, %r15, 524280(%r11)
|
||||
; CHECK: br %r14
|
||||
%y = alloca [65503 x i64], align 8
|
||||
%ptr = getelementptr inbounds [65503 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65502 x i64], align 8
|
||||
%ptr = getelementptr inbounds [65502 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
@ -139,12 +139,12 @@ define void @f5(i64 %x) {
|
||||
; CHECK: .cfi_def_cfa_offset 524360
|
||||
; CHECK: lgr %r11, %r15
|
||||
; CHECK: .cfi_def_cfa_register %r11
|
||||
; CHECK: stg %r2, 168(%r11)
|
||||
; CHECK: stg %r2, 176(%r11)
|
||||
; CHECK: aghi %r11, 8
|
||||
; CHECK: lmg %r11, %r15, 524280(%r11)
|
||||
; CHECK: br %r14
|
||||
%y = alloca [65504 x i64], align 8
|
||||
%ptr = getelementptr inbounds [65504 x i64]* %y, i64 0, i64 0
|
||||
%y = alloca [65503 x i64], align 8
|
||||
%ptr = getelementptr inbounds [65503 x i64]* %y, i64 0, i64 0
|
||||
store volatile i64 %x, i64* %ptr
|
||||
ret void
|
||||
}
|
||||
|
@ -17,9 +17,9 @@
|
||||
; First check the highest in-range offset after conversion, which is 4092
|
||||
; for word-addressing instructions like MVHI.
|
||||
;
|
||||
; The last in-range doubleword offset is 4088. Since the frame has an
|
||||
; emergency spill slot at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is (4088 - 168) / 4 = 980
|
||||
; The last in-range doubleword offset is 4088. Since the frame has two
|
||||
; emergency spill slots at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is (4088 - 176) / 4 = 978
|
||||
; words.
|
||||
define void @f1() {
|
||||
; CHECK-NOFP: f1:
|
||||
@ -29,10 +29,10 @@ define void @f1() {
|
||||
; CHECK-FP: f1:
|
||||
; CHECK-FP: mvhi 4092(%r11), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x i32], align 8
|
||||
%region2 = alloca [980 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [980 x i32]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [980 x i32]* %region2, i64 0, i64 1
|
||||
%region1 = alloca [978 x i32], align 8
|
||||
%region2 = alloca [978 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [978 x i32]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [978 x i32]* %region2, i64 0, i64 1
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -49,10 +49,10 @@ define void @f2() {
|
||||
; CHECK-FP: lay %r1, 4096(%r11)
|
||||
; CHECK-FP: mvhi 0(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x i32], align 8
|
||||
%region2 = alloca [980 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [980 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [980 x i32]* %region2, i64 0, i64 2
|
||||
%region1 = alloca [978 x i32], align 8
|
||||
%region2 = alloca [978 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [978 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [978 x i32]* %region2, i64 0, i64 2
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -69,10 +69,10 @@ define void @f3() {
|
||||
; CHECK-FP: lay %r1, 4096(%r11)
|
||||
; CHECK-FP: mvhi 4(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x i32], align 8
|
||||
%region2 = alloca [980 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [980 x i32]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [980 x i32]* %region2, i64 0, i64 3
|
||||
%region1 = alloca [978 x i32], align 8
|
||||
%region2 = alloca [978 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [978 x i32]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [978 x i32]* %region2, i64 0, i64 3
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -89,10 +89,10 @@ define void @f4() {
|
||||
; CHECK-FP: lay %r1, 4096(%r11)
|
||||
; CHECK-FP: mvhi 4092(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x i32], align 8
|
||||
%region2 = alloca [2004 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2004 x i32]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [2004 x i32]* %region2, i64 0, i64 1
|
||||
%region1 = alloca [2002 x i32], align 8
|
||||
%region2 = alloca [2002 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2002 x i32]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [2002 x i32]* %region2, i64 0, i64 1
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -109,10 +109,10 @@ define void @f5() {
|
||||
; CHECK-FP: lay %r1, 8192(%r11)
|
||||
; CHECK-FP: mvhi 0(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x i32], align 8
|
||||
%region2 = alloca [2004 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2004 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [2004 x i32]* %region2, i64 0, i64 2
|
||||
%region1 = alloca [2002 x i32], align 8
|
||||
%region2 = alloca [2002 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2002 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [2002 x i32]* %region2, i64 0, i64 2
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -129,17 +129,17 @@ define void @f6() {
|
||||
; CHECK-FP: lay %r1, 8192(%r11)
|
||||
; CHECK-FP: mvhi 4(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x i32], align 8
|
||||
%region2 = alloca [2004 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2004 x i32]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [2004 x i32]* %region2, i64 0, i64 3
|
||||
%region1 = alloca [2002 x i32], align 8
|
||||
%region2 = alloca [2002 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2002 x i32]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [2002 x i32]* %region2, i64 0, i64 3
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
}
|
||||
|
||||
; Now try an offset of 4092 from the start of the object, with the object
|
||||
; being at offset 8192. This time we need objects of (8192 - 168) / 4 = 2006
|
||||
; being at offset 8192. This time we need objects of (8192 - 176) / 4 = 2004
|
||||
; words.
|
||||
define void @f7() {
|
||||
; CHECK-NOFP: f7:
|
||||
@ -151,10 +151,10 @@ define void @f7() {
|
||||
; CHECK-FP: lay %r1, 8192(%r11)
|
||||
; CHECK-FP: mvhi 4092(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2006 x i32], align 8
|
||||
%region2 = alloca [2006 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2006 x i32]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2006 x i32]* %region2, i64 0, i64 1023
|
||||
%region1 = alloca [2004 x i32], align 8
|
||||
%region2 = alloca [2004 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2004 x i32]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2004 x i32]* %region2, i64 0, i64 1023
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -172,10 +172,10 @@ define void @f8() {
|
||||
; CHECK-FP: lay %r1, 12288(%r11)
|
||||
; CHECK-FP: mvhi 4(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2008 x i32], align 8
|
||||
%region2 = alloca [2008 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2008 x i32]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2008 x i32]* %region2, i64 0, i64 1023
|
||||
%region1 = alloca [2006 x i32], align 8
|
||||
%region2 = alloca [2006 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2006 x i32]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2006 x i32]* %region2, i64 0, i64 1023
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
@ -194,41 +194,41 @@ define void @f9() {
|
||||
; CHECK-FP: lay %r1, 12296(%r11)
|
||||
; CHECK-FP: mvhi 0(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2008 x i32], align 8
|
||||
%region2 = alloca [2008 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2008 x i32]* %region1, i64 0, i64 1024
|
||||
%ptr2 = getelementptr inbounds [2008 x i32]* %region2, i64 0, i64 1024
|
||||
%region1 = alloca [2006 x i32], align 8
|
||||
%region2 = alloca [2006 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [2006 x i32]* %region1, i64 0, i64 1024
|
||||
%ptr2 = getelementptr inbounds [2006 x i32]* %region2, i64 0, i64 1024
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
ret void
|
||||
}
|
||||
|
||||
; Repeat f2 in a case that needs the emergency spill slot (because all
|
||||
; Repeat f2 in a case that needs the emergency spill slots (because all
|
||||
; call-clobbered registers are live and no call-saved ones have been
|
||||
; allocated).
|
||||
define void @f10(i32 *%vptr) {
|
||||
; CHECK-NOFP: f10:
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: lay [[REGISTER]], 4096(%r15)
|
||||
; CHECK-NOFP: mvhi 0([[REGISTER]]), 42
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f10:
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: lay [[REGISTER]], 4096(%r11)
|
||||
; CHECK-FP: mvhi 0([[REGISTER]]), 42
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
%i1 = load volatile i32 *%vptr
|
||||
%i3 = load volatile i32 *%vptr
|
||||
%i4 = load volatile i32 *%vptr
|
||||
%i5 = load volatile i32 *%vptr
|
||||
%region1 = alloca [980 x i32], align 8
|
||||
%region2 = alloca [980 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [980 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [980 x i32]* %region2, i64 0, i64 2
|
||||
%region1 = alloca [978 x i32], align 8
|
||||
%region2 = alloca [978 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [978 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [978 x i32]* %region2, i64 0, i64 2
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
@ -239,26 +239,26 @@ define void @f10(i32 *%vptr) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; And again with maximum register pressure. The only spill slot that the
|
||||
; NOFP case needs is the emergency one, so the offsets are the same as for f2.
|
||||
; And again with maximum register pressure. The only spill slots that the
|
||||
; NOFP case needs are the emergency ones, so the offsets are the same as for f2.
|
||||
; However, the FP case uses %r11 as the frame pointer and must therefore
|
||||
; spill a second register. This leads to an extra displacement of 8.
|
||||
define void @f11(i32 *%vptr) {
|
||||
; CHECK-NOFP: f11:
|
||||
; CHECK-NOFP: stmg %r6, %r15,
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: lay [[REGISTER]], 4096(%r15)
|
||||
; CHECK-NOFP: mvhi 0([[REGISTER]]), 42
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: lmg %r6, %r15,
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f11:
|
||||
; CHECK-FP: stmg %r6, %r15,
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: lay [[REGISTER]], 4096(%r11)
|
||||
; CHECK-FP: mvhi 8([[REGISTER]]), 42
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: lmg %r6, %r15,
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
@ -275,10 +275,10 @@ define void @f11(i32 *%vptr) {
|
||||
%i12 = load volatile i32 *%vptr
|
||||
%i13 = load volatile i32 *%vptr
|
||||
%i14 = load volatile i32 *%vptr
|
||||
%region1 = alloca [980 x i32], align 8
|
||||
%region2 = alloca [980 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [980 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [980 x i32]* %region2, i64 0, i64 2
|
||||
%region1 = alloca [978 x i32], align 8
|
||||
%region2 = alloca [978 x i32], align 8
|
||||
%ptr1 = getelementptr inbounds [978 x i32]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [978 x i32]* %region2, i64 0, i64 2
|
||||
store volatile i32 42, i32 *%ptr1
|
||||
store volatile i32 42, i32 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
; First check the highest offset that is in range of the 12-bit form.
|
||||
;
|
||||
; The last in-range doubleword offset is 4088. Since the frame has an
|
||||
; emergency spill slot at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is 4088 - 168 = 3920 bytes.
|
||||
; The last in-range doubleword offset is 4088. Since the frame has two
|
||||
; emergency spill slots at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is 4088 - 176 = 3912 bytes.
|
||||
define void @f1() {
|
||||
; CHECK-NOFP: f1:
|
||||
; CHECK-NOFP: mvi 4095(%r15), 42
|
||||
@ -27,10 +27,10 @@ define void @f1() {
|
||||
; CHECK-FP: f1:
|
||||
; CHECK-FP: mvi 4095(%r11), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [3920 x i8], align 8
|
||||
%region2 = alloca [3920 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3920 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [3920 x i8]* %region2, i64 0, i64 7
|
||||
%region1 = alloca [3912 x i8], align 8
|
||||
%region2 = alloca [3912 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3912 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [3912 x i8]* %region2, i64 0, i64 7
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -45,10 +45,10 @@ define void @f2() {
|
||||
; CHECK-FP: f2:
|
||||
; CHECK-FP: mviy 4096(%r11), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [3920 x i8], align 8
|
||||
%region2 = alloca [3920 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3920 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [3920 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [3912 x i8], align 8
|
||||
%region2 = alloca [3912 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3912 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [3912 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -57,7 +57,7 @@ define void @f2() {
|
||||
; Test the last offset that is in range of the 20-bit form.
|
||||
;
|
||||
; The last in-range doubleword offset is 524280, so by the same reasoning
|
||||
; as above, we need to allocate objects of 524280 - 168 = 524122 bytes.
|
||||
; as above, we need to allocate objects of 524280 - 176 = 524104 bytes.
|
||||
define void @f3() {
|
||||
; CHECK-NOFP: f3:
|
||||
; CHECK-NOFP: mviy 524287(%r15), 42
|
||||
@ -66,10 +66,10 @@ define void @f3() {
|
||||
; CHECK-FP: f3:
|
||||
; CHECK-FP: mviy 524287(%r11), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 7
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 7
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -90,10 +90,10 @@ define void @f4() {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: mvi 0(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -113,10 +113,10 @@ define void @f5() {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: mvi 4095(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 4103
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 4103
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 4103
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 4103
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -135,10 +135,10 @@ define void @f6() {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: mviy 4096(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 4104
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 4104
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 4104
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 4104
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -160,10 +160,10 @@ define void @f7() {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: mviy 65535(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524287
|
||||
%region1 = alloca [1048400 x i8], align 8
|
||||
%region2 = alloca [1048400 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048400 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048400 x i8]* %region2, i64 0, i64 524287
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -183,10 +183,10 @@ define void @f8() {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: mvi 7(%r1), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048416 x i8], align 8
|
||||
%region2 = alloca [1048416 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048416 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048416 x i8]* %region2, i64 0, i64 524287
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524287
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
@ -213,43 +213,43 @@ define void @f9() {
|
||||
; CHECK-FP: agfi [[R2]], 524288
|
||||
; CHECK-FP: mvi 0([[R2]]), 42
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048416 x i8], align 8
|
||||
%region2 = alloca [1048416 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048416 x i8]* %region1, i64 0, i64 524288
|
||||
%ptr2 = getelementptr inbounds [1048416 x i8]* %region2, i64 0, i64 524288
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524288
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524288
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
ret void
|
||||
}
|
||||
|
||||
; Repeat f4 in a case that needs the emergency spill slot (because all
|
||||
; Repeat f4 in a case that needs the emergency spill slots (because all
|
||||
; call-clobbered registers are live and no call-saved ones have been
|
||||
; allocated).
|
||||
define void @f10(i32 *%vptr) {
|
||||
; CHECK-NOFP: f10:
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: llilh [[REGISTER]], 8
|
||||
; CHECK-NOFP: agr [[REGISTER]], %r15
|
||||
; CHECK-NOFP: mvi 0([[REGISTER]]), 42
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f10:
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: llilh [[REGISTER]], 8
|
||||
; CHECK-FP: agr [[REGISTER]], %r11
|
||||
; CHECK-FP: mvi 0([[REGISTER]]), 42
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
%i1 = load volatile i32 *%vptr
|
||||
%i3 = load volatile i32 *%vptr
|
||||
%i4 = load volatile i32 *%vptr
|
||||
%i5 = load volatile i32 *%vptr
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
@ -260,28 +260,28 @@ define void @f10(i32 *%vptr) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; And again with maximum register pressure. The only spill slot that the
|
||||
; NOFP case needs is the emergency one, so the offsets are the same as for f4.
|
||||
; And again with maximum register pressure. The only spill slots that the
|
||||
; NOFP case needs are the emergency ones, so the offsets are the same as for f4.
|
||||
; However, the FP case uses %r11 as the frame pointer and must therefore
|
||||
; spill a second register. This leads to an extra displacement of 8.
|
||||
define void @f11(i32 *%vptr) {
|
||||
; CHECK-NOFP: f11:
|
||||
; CHECK-NOFP: stmg %r6, %r15,
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: llilh [[REGISTER]], 8
|
||||
; CHECK-NOFP: agr [[REGISTER]], %r15
|
||||
; CHECK-NOFP: mvi 0([[REGISTER]]), 42
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: lmg %r6, %r15,
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f11:
|
||||
; CHECK-FP: stmg %r6, %r15,
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: llilh [[REGISTER]], 8
|
||||
; CHECK-FP: agr [[REGISTER]], %r11
|
||||
; CHECK-FP: mvi 8([[REGISTER]]), 42
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: lmg %r6, %r15,
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
@ -298,10 +298,10 @@ define void @f11(i32 *%vptr) {
|
||||
%i12 = load volatile i32 *%vptr
|
||||
%i13 = load volatile i32 *%vptr
|
||||
%i14 = load volatile i32 *%vptr
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 42, i8 *%ptr1
|
||||
store volatile i8 42, i8 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
|
@ -19,9 +19,9 @@ declare void @foo(float *%ptr1, float *%ptr2)
|
||||
; First check the highest in-range offset after conversion, which is 4092
|
||||
; for word-addressing instructions like LDEB.
|
||||
;
|
||||
; The last in-range doubleword offset is 4088. Since the frame has an
|
||||
; emergency spill slot at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is (4088 - 168) / 4 = 980
|
||||
; The last in-range doubleword offset is 4088. Since the frame has two
|
||||
; emergency spill slots at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is (4088 - 176) / 4 = 978
|
||||
; words.
|
||||
define void @f1(double *%dst) {
|
||||
; CHECK-NOFP: f1:
|
||||
@ -31,13 +31,13 @@ define void @f1(double *%dst) {
|
||||
; CHECK-FP: f1:
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4092(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x float], align 8
|
||||
%region2 = alloca [980 x float], align 8
|
||||
%start1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [978 x float], align 8
|
||||
%region2 = alloca [978 x float], align 8
|
||||
%start1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 1
|
||||
%ptr1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 1
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -58,13 +58,13 @@ define void @f2(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 4096
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 0(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x float], align 8
|
||||
%region2 = alloca [980 x float], align 8
|
||||
%start1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [978 x float], align 8
|
||||
%region2 = alloca [978 x float], align 8
|
||||
%start1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 2
|
||||
%ptr1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 2
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -85,13 +85,13 @@ define void @f3(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 4096
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x float], align 8
|
||||
%region2 = alloca [980 x float], align 8
|
||||
%start1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [978 x float], align 8
|
||||
%region2 = alloca [978 x float], align 8
|
||||
%start1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 3
|
||||
%ptr1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 3
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -112,13 +112,13 @@ define void @f4(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 4096
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4092(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x float], align 8
|
||||
%region2 = alloca [2004 x float], align 8
|
||||
%start1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2002 x float], align 8
|
||||
%region2 = alloca [2002 x float], align 8
|
||||
%start1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 1
|
||||
%ptr1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 1
|
||||
%ptr2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 1
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -139,13 +139,13 @@ define void @f5(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 8192
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 0(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x float], align 8
|
||||
%region2 = alloca [2004 x float], align 8
|
||||
%start1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2002 x float], align 8
|
||||
%region2 = alloca [2002 x float], align 8
|
||||
%start1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 2
|
||||
%ptr1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 2
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -166,13 +166,13 @@ define void @f6(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 8192
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2004 x float], align 8
|
||||
%region2 = alloca [2004 x float], align 8
|
||||
%start1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2002 x float], align 8
|
||||
%region2 = alloca [2002 x float], align 8
|
||||
%start1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 3
|
||||
%ptr1 = getelementptr inbounds [2002 x float]* %region1, i64 0, i64 3
|
||||
%ptr2 = getelementptr inbounds [2002 x float]* %region2, i64 0, i64 3
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -183,7 +183,7 @@ define void @f6(double *%dst) {
|
||||
}
|
||||
|
||||
; Now try an offset of 4092 from the start of the object, with the object
|
||||
; being at offset 8192. This time we need objects of (8192 - 168) / 4 = 2006
|
||||
; being at offset 8192. This time we need objects of (8192 - 168) / 4 = 2004
|
||||
; words.
|
||||
define void @f7(double *%dst) {
|
||||
; CHECK-NOFP: f7:
|
||||
@ -195,13 +195,13 @@ define void @f7(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 8192
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4092(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2006 x float], align 8
|
||||
%region2 = alloca [2006 x float], align 8
|
||||
%start1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2004 x float], align 8
|
||||
%region2 = alloca [2004 x float], align 8
|
||||
%start1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 1023
|
||||
%ptr1 = getelementptr inbounds [2004 x float]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2004 x float]* %region2, i64 0, i64 1023
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -223,13 +223,13 @@ define void @f8(double *%dst) {
|
||||
; CHECK-FP: lghi %r1, 12288
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 4(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2008 x float], align 8
|
||||
%region2 = alloca [2008 x float], align 8
|
||||
%start1 = getelementptr inbounds [2008 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2008 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2006 x float], align 8
|
||||
%region2 = alloca [2006 x float], align 8
|
||||
%start1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2008 x float]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2008 x float]* %region2, i64 0, i64 1023
|
||||
%ptr1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 1023
|
||||
%ptr2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 1023
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -252,13 +252,13 @@ define void @f9(double *%dst) {
|
||||
; CHECK-FP: lay %r1, 12296(%r11)
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 0(%r1)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [2008 x float], align 8
|
||||
%region2 = alloca [2008 x float], align 8
|
||||
%start1 = getelementptr inbounds [2008 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2008 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [2006 x float], align 8
|
||||
%region2 = alloca [2006 x float], align 8
|
||||
%start1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [2008 x float]* %region1, i64 0, i64 1024
|
||||
%ptr2 = getelementptr inbounds [2008 x float]* %region2, i64 0, i64 1024
|
||||
%ptr1 = getelementptr inbounds [2006 x float]* %region1, i64 0, i64 1024
|
||||
%ptr2 = getelementptr inbounds [2006 x float]* %region2, i64 0, i64 1024
|
||||
%float1 = load float *%ptr1
|
||||
%float2 = load float *%ptr2
|
||||
%double1 = fpext float %float1 to double
|
||||
@ -268,31 +268,31 @@ define void @f9(double *%dst) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; Repeat f2 in a case that needs the emergency spill slot, because all
|
||||
; Repeat f2 in a case that needs the emergency spill slots, because all
|
||||
; call-clobbered and allocated call-saved registers are live. Note that
|
||||
; %vptr and %dst are copied to call-saved registers, freeing up %r2 and
|
||||
; %r3 during the main test.
|
||||
define void @f10(i32 *%vptr, double *%dst) {
|
||||
; CHECK-NOFP: f10:
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: lghi [[REGISTER]], 4096
|
||||
; CHECK-NOFP: ldeb {{%f[0-7]}}, 0([[REGISTER]],%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f10:
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: lghi [[REGISTER]], 4096
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 0([[REGISTER]],%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x float], align 8
|
||||
%region2 = alloca [980 x float], align 8
|
||||
%start1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [978 x float], align 8
|
||||
%region2 = alloca [978 x float], align 8
|
||||
%start1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%ptr1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 2
|
||||
%ptr1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 2
|
||||
%ptr2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 2
|
||||
%i0 = load volatile i32 *%vptr
|
||||
%i1 = load volatile i32 *%vptr
|
||||
%i2 = load volatile i32 *%vptr
|
||||
@ -329,13 +329,13 @@ define void @f11(double *%dst, i64 %index) {
|
||||
; CHECK-FP: lay %r1, 4096(%r11)
|
||||
; CHECK-FP: ldeb {{%f[0-7]}}, 0([[REGISTER]],%r1)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [980 x float], align 8
|
||||
%region2 = alloca [980 x float], align 8
|
||||
%start1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 0
|
||||
%region1 = alloca [978 x float], align 8
|
||||
%region2 = alloca [978 x float], align 8
|
||||
%start1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 0
|
||||
%start2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 0
|
||||
call void @foo(float *%start1, float *%start2)
|
||||
%elem1 = getelementptr inbounds [980 x float]* %region1, i64 0, i64 2
|
||||
%elem2 = getelementptr inbounds [980 x float]* %region2, i64 0, i64 2
|
||||
%elem1 = getelementptr inbounds [978 x float]* %region1, i64 0, i64 2
|
||||
%elem2 = getelementptr inbounds [978 x float]* %region2, i64 0, i64 2
|
||||
%base1 = ptrtoint float *%elem1 to i64
|
||||
%base2 = ptrtoint float *%elem2 to i64
|
||||
%addr1 = add i64 %base1, %index
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
; First check the highest offset that is in range of the 12-bit form.
|
||||
;
|
||||
; The last in-range doubleword offset is 4088. Since the frame has an
|
||||
; emergency spill slot at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is 4088 - 168 = 3920 bytes.
|
||||
; The last in-range doubleword offset is 4088. Since the frame has two
|
||||
; emergency spill slots at 160(%r15), the amount that we need to allocate
|
||||
; in order to put another object at offset 4088 is 4088 - 176 = 3912 bytes.
|
||||
define void @f1(i8 %byte) {
|
||||
; CHECK-NOFP: f1:
|
||||
; CHECK-NOFP: stc %r2, 4095(%r15)
|
||||
@ -27,10 +27,10 @@ define void @f1(i8 %byte) {
|
||||
; CHECK-FP: f1:
|
||||
; CHECK-FP: stc %r2, 4095(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [3920 x i8], align 8
|
||||
%region2 = alloca [3920 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3920 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [3920 x i8]* %region2, i64 0, i64 7
|
||||
%region1 = alloca [3912 x i8], align 8
|
||||
%region2 = alloca [3912 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3912 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [3912 x i8]* %region2, i64 0, i64 7
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -45,10 +45,10 @@ define void @f2(i8 %byte) {
|
||||
; CHECK-FP: f2:
|
||||
; CHECK-FP: stcy %r2, 4096(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [3920 x i8], align 8
|
||||
%region2 = alloca [3920 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3920 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [3920 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [3912 x i8], align 8
|
||||
%region2 = alloca [3912 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [3912 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [3912 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -57,7 +57,7 @@ define void @f2(i8 %byte) {
|
||||
; Test the last offset that is in range of the 20-bit form.
|
||||
;
|
||||
; The last in-range doubleword offset is 524280, so by the same reasoning
|
||||
; as above, we need to allocate objects of 524280 - 168 = 524122 bytes.
|
||||
; as above, we need to allocate objects of 524280 - 176 = 524104 bytes.
|
||||
define void @f3(i8 %byte) {
|
||||
; CHECK-NOFP: f3:
|
||||
; CHECK-NOFP: stcy %r2, 524287(%r15)
|
||||
@ -66,10 +66,10 @@ define void @f3(i8 %byte) {
|
||||
; CHECK-FP: f3:
|
||||
; CHECK-FP: stcy %r2, 524287(%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 7
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 7
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 7
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -88,10 +88,10 @@ define void @f4(i8 %byte) {
|
||||
; CHECK-FP: llilh %r1, 8
|
||||
; CHECK-FP: stc %r2, 0(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -109,10 +109,10 @@ define void @f5(i8 %byte) {
|
||||
; CHECK-FP: llilh %r1, 8
|
||||
; CHECK-FP: stc %r2, 4095(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 4103
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 4103
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 4103
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 4103
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -129,10 +129,10 @@ define void @f6(i8 %byte) {
|
||||
; CHECK-FP: llilh %r1, 8
|
||||
; CHECK-FP: stcy %r2, 4096(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 4104
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 4104
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 4104
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 4104
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -152,10 +152,10 @@ define void @f7(i8 %byte) {
|
||||
; CHECK-FP: llilh %r1, 23
|
||||
; CHECK-FP: stcy %r2, 65535(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524287
|
||||
%region1 = alloca [1048400 x i8], align 8
|
||||
%region2 = alloca [1048400 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048400 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048400 x i8]* %region2, i64 0, i64 524287
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -173,10 +173,10 @@ define void @f8(i8 %byte) {
|
||||
; CHECK-FP: llilh %r1, 24
|
||||
; CHECK-FP: stc %r2, 7(%r1,%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048416 x i8], align 8
|
||||
%region2 = alloca [1048416 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048416 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048416 x i8]* %region2, i64 0, i64 524287
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524287
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524287
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
@ -203,40 +203,40 @@ define void @f9(i8 %byte) {
|
||||
; CHECK-FP: agfi [[R2]], 524288
|
||||
; CHECK-FP: stc %r2, 0([[R2]])
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [1048416 x i8], align 8
|
||||
%region2 = alloca [1048416 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048416 x i8]* %region1, i64 0, i64 524288
|
||||
%ptr2 = getelementptr inbounds [1048416 x i8]* %region2, i64 0, i64 524288
|
||||
%region1 = alloca [1048408 x i8], align 8
|
||||
%region2 = alloca [1048408 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [1048408 x i8]* %region1, i64 0, i64 524288
|
||||
%ptr2 = getelementptr inbounds [1048408 x i8]* %region2, i64 0, i64 524288
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
}
|
||||
|
||||
; Repeat f4 in a case that needs the emergency spill slot (because all
|
||||
; Repeat f4 in a case that needs the emergency spill slots (because all
|
||||
; call-clobbered registers are live and no call-saved ones have been
|
||||
; allocated).
|
||||
define void @f10(i32 *%vptr, i8 %byte) {
|
||||
; CHECK-NOFP: f10:
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: llilh [[REGISTER]], 8
|
||||
; CHECK-NOFP: stc %r3, 0([[REGISTER]],%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f10:
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: llilh [[REGISTER]], 8
|
||||
; CHECK-FP: stc %r3, 0([[REGISTER]],%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
%i1 = load volatile i32 *%vptr
|
||||
%i4 = load volatile i32 *%vptr
|
||||
%i5 = load volatile i32 *%vptr
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
@ -246,26 +246,26 @@ define void @f10(i32 *%vptr, i8 %byte) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; And again with maximum register pressure. The only spill slot that the
|
||||
; NOFP case needs is the emergency one, so the offsets are the same as for f4.
|
||||
; And again with maximum register pressure. The only spill slots that the
|
||||
; NOFP case needs are the emergency ones, so the offsets are the same as for f4.
|
||||
; However, the FP case uses %r11 as the frame pointer and must therefore
|
||||
; spill a second register. This leads to an extra displacement of 8.
|
||||
define void @f11(i32 *%vptr, i8 %byte) {
|
||||
; CHECK-NOFP: f11:
|
||||
; CHECK-NOFP: stmg %r6, %r15,
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r15)
|
||||
; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15)
|
||||
; CHECK-NOFP: llilh [[REGISTER]], 8
|
||||
; CHECK-NOFP: stc %r3, 0([[REGISTER]],%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], 160(%r15)
|
||||
; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15)
|
||||
; CHECK-NOFP: lmg %r6, %r15,
|
||||
; CHECK-NOFP: br %r14
|
||||
;
|
||||
; CHECK-FP: f11:
|
||||
; CHECK-FP: stmg %r6, %r15,
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], 160(%r11)
|
||||
; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11)
|
||||
; CHECK-FP: llilh [[REGISTER]], 8
|
||||
; CHECK-FP: stc %r3, 8([[REGISTER]],%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], 160(%r11)
|
||||
; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11)
|
||||
; CHECK-FP: lmg %r6, %r15,
|
||||
; CHECK-FP: br %r14
|
||||
%i0 = load volatile i32 *%vptr
|
||||
@ -281,10 +281,10 @@ define void @f11(i32 *%vptr, i8 %byte) {
|
||||
%i12 = load volatile i32 *%vptr
|
||||
%i13 = load volatile i32 *%vptr
|
||||
%i14 = load volatile i32 *%vptr
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 8
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 8
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
store volatile i32 %i0, i32 *%vptr
|
||||
@ -316,11 +316,11 @@ define void @f12(i8 %byte, i64 %index) {
|
||||
; CHECK-FP: agr %r1, %r11
|
||||
; CHECK-FP: stc %r2, 0(%r3,%r1)
|
||||
; CHECK-FP: br %r14
|
||||
%region1 = alloca [524112 x i8], align 8
|
||||
%region2 = alloca [524112 x i8], align 8
|
||||
%region1 = alloca [524104 x i8], align 8
|
||||
%region2 = alloca [524104 x i8], align 8
|
||||
%index1 = add i64 %index, 8
|
||||
%ptr1 = getelementptr inbounds [524112 x i8]* %region1, i64 0, i64 %index1
|
||||
%ptr2 = getelementptr inbounds [524112 x i8]* %region2, i64 0, i64 %index1
|
||||
%ptr1 = getelementptr inbounds [524104 x i8]* %region1, i64 0, i64 %index1
|
||||
%ptr2 = getelementptr inbounds [524104 x i8]* %region2, i64 0, i64 %index1
|
||||
store volatile i8 %byte, i8 *%ptr1
|
||||
store volatile i8 %byte, i8 *%ptr2
|
||||
ret void
|
||||
|
Loading…
Reference in New Issue
Block a user