summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/AArch64/ldst-opt.mir26
-rw-r--r--test/CodeGen/ARM/aeabi-read-tp.ll26
2 files changed, 46 insertions, 6 deletions
diff --git a/test/CodeGen/AArch64/ldst-opt.mir b/test/CodeGen/AArch64/ldst-opt.mir
index 8f0b71be3483..85b655b717ca 100644
--- a/test/CodeGen/AArch64/ldst-opt.mir
+++ b/test/CodeGen/AArch64/ldst-opt.mir
@@ -1,10 +1,4 @@
# RUN: llc -mtriple=aarch64--linux-gnu -run-pass=aarch64-ldst-opt %s -verify-machineinstrs -o - 2>&1 | FileCheck %s
---- |
- define void @promote-load-from-store() { ret void }
- define void @store-pair() { ret void }
- define void @store-pair-clearkill0() { ret void }
- define void @store-pair-clearkill1() { ret void }
-...
---
name: promote-load-from-store
tracksRegLiveness: true
@@ -130,3 +124,23 @@ body: |
# CHECK-NOT: %w2 = COPY killed %w1
# CHECK: %w2 = COPY %w1
# CHECK: STPWi %w1, killed %w2, killed %x0, 0
+---
+name: store-load-clearkill
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: %w1
+
+ STRWui %w1, %sp, 0 :: (store 4)
+ %wzr = COPY killed %w1 ; killing use of %w1
+ %w11 = LDRWui %sp, 0 :: (load 4)
+ HINT 0, implicit %w11 ; some use of %w11
+...
+# When replaceing the load of a store-load pair with a copy the kill flags
+# along the way need to be cleared.
+# CHECK-LABEL: name: store-load-clearkill
+# CHECK: STRWui %w1, %sp, 0 :: (store 4)
+# CHECK-NOT: COPY killed %w1
+# CHECK: %wzr = COPY %w1
+# CHECK: %w11 = ORRWrs %wzr, %w1, 0
+# CHECK: HINT 0, implicit %w11
diff --git a/test/CodeGen/ARM/aeabi-read-tp.ll b/test/CodeGen/ARM/aeabi-read-tp.ll
new file mode 100644
index 000000000000..5f9815b6cd77
--- /dev/null
+++ b/test/CodeGen/ARM/aeabi-read-tp.ll
@@ -0,0 +1,26 @@
+; RUN: llc -mtriple armv7---eabi -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-SHORT
+; RUN: llc -mtriple thumbv7---eabi -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-SHORT
+; RUN: llc -mtriple armv7---eabi -mattr=+long-calls -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-LONG
+; RUN: llc -mtriple thumbv7---eabi -mattr=+long-calls -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-LONG
+
+@i = thread_local local_unnamed_addr global i32 0, align 4
+
+define i32 @f() local_unnamed_addr {
+entry:
+ %0 = load i32, i32* @i, align 4
+ ret i32 %0
+}
+
+; CHECK-LABEL: f:
+; CHECK-SHORT: ldr r1, [[VAR:.LCPI[0-9]+_[0-9]+]]
+; CHECK-SHORT-NEXT: bl __aeabi_read_tp
+; CHECK-SHORT: [[VAR]]:
+; CHECK-SHORT-NEXT: .long i(TPOFF)
+
+; CHECK-LONG: ldr [[REG:r[0-9]+]], [[FUN:.LCPI[0-9]+_[0-9]+]]
+; CHECK-LONG-NEXT: ldr r1, [[VAR:.LCPI[0-9]+_[0-9]+]]
+; CHECK-LONG-NEXT: blx [[REG]]
+; CHECK-LONG: [[VAR]]:
+; CHECK-LONG-NEXT: .long i(TPOFF)
+; CHECK-LONG: [[FUN]]:
+; CHECK-LONG-NEXT: .long __aeabi_read_tp