summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorPuyan Lotfi <puyan@puyan.org>2018-04-16 09:03:03 +0000
committerPuyan Lotfi <puyan@puyan.org>2018-04-16 09:03:03 +0000
commit14b6637edc41125997bf395f1a3504e7288b0e93 (patch)
treeb9a4bff6f5335a446139d74f9dac4ee42b077e95 /llvm/test/CodeGen
parentfab368099010e07ca440c6b3f392686301347067 (diff)
downloadbcm5719-llvm-14b6637edc41125997bf395f1a3504e7288b0e93.tar.gz
bcm5719-llvm-14b6637edc41125997bf395f1a3504e7288b0e93.zip
[MIR-Canon] Adding ISA-Agnostic COPY Folding.
Transforms the following: %vreg1234:gpr32 = COPY %42 %vreg1235:gpr32 = COPY %vreg1234 %vreg1236:gpr32 = COPY %vreg1235 $w0 = COPY %vreg1236 into: $w0 = COPY %42 Assuming %42 is also a gpr32 llvm-svn: 330113
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir45
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir b/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir
new file mode 100644
index 00000000000..f3c20075860
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir
@@ -0,0 +1,45 @@
+# RUN: llc -mtriple=arm64-apple-ios11.0.0 -o - -run-pass mir-canonicalizer %s | FileCheck %s
+
+...
+---
+name: Proc8
+stack:
+ - { id: 0, type: default, offset: 0, size: 4, alignment: 4,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -4, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 1, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -16, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 2, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -24, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 3, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -32, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 4, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -40, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 5, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -48, di-variable: '', di-expression: '', di-location: '' }
+ - { id: 6, type: default, offset: 0, size: 8, alignment: 8,
+ stack-id: 0, callee-saved-register: '', callee-saved-restored: true,
+ local-offset: -56, di-variable: '', di-expression: '', di-location: '' }
+constants:
+body: |
+ bb.0:
+ liveins: $x0, $x1, $d0, $d1
+
+ %42:gpr32 = LDRWui %stack.0, 0 :: (dereferenceable load 8)
+
+ ;CHECK: %namedVReg1352:gpr32 = LDRWui %stack.0, 0 :: (dereferenceable load 8)
+ ;CHECK: $w0 = COPY %namedVReg1352
+ ;CHECK: RET_ReallyLR implicit $w0
+
+ %vreg1234:gpr32 = COPY %42
+ %vreg1235:gpr32 = COPY %vreg1234
+ %vreg1236:gpr32 = COPY %vreg1235
+ $w0 = COPY %vreg1236
+ RET_ReallyLR implicit $w0
+
+...
OpenPOWER on IntegriCloud