summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorAlexander Timofeev <Alexander.Timofeev@amd.com>2017-11-10 12:21:10 +0000
committerAlexander Timofeev <Alexander.Timofeev@amd.com>2017-11-10 12:21:10 +0000
commit28da06778fb1f91f6fe854d034d75cc44a817d94 (patch)
tree259c74f17f0b8b91f94bbf6b6c26208268342b38 /llvm/test/CodeGen
parent13cc995c3d7ce55326f255718ee1f09fb4ca8bbb (diff)
downloadbcm5719-llvm-28da06778fb1f91f6fe854d034d75cc44a817d94.tar.gz
bcm5719-llvm-28da06778fb1f91f6fe854d034d75cc44a817d94.zip
[AMDGPU] Prevent Machine Copy Propagation from replacing live copy with the dead one
Differential revision: https://reviews.llvm.org/D38754 llvm-svn: 317884
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AMDGPU/dead_copy.mir27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/dead_copy.mir b/llvm/test/CodeGen/AMDGPU/dead_copy.mir
new file mode 100644
index 00000000000..d581b29a195
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/dead_copy.mir
@@ -0,0 +1,27 @@
+# RUN: llc -o - %s -march=amdgcn -mcpu=fiji -run-pass=machine-cp -verify-machineinstrs | FileCheck -check-prefix=GCN %s
+
+# GCN-LABEL: dead_copy
+# GCN: bb.0
+# GCN-NOT: dead %vgpr5 = COPY undef %vgpr11, implicit %exec
+# GCN: %vgpr5 = COPY %vgpr11, implicit %exec
+
+---
+name: dead_copy
+
+body: |
+
+ bb.0:
+ liveins: %vgpr11, %sgpr0, %sgpr1, %vgpr6, %vgpr7, %vgpr4
+
+ dead %vgpr5 = COPY undef %vgpr11, implicit %exec
+
+ %vgpr5 = COPY %vgpr11, implicit %exec
+
+ %sgpr14 = S_ADD_U32 %sgpr0, target-flags(amdgpu-gotprel) 1136, implicit-def %scc
+ %sgpr15 = S_ADDC_U32 %sgpr1, target-flags(amdgpu-gotprel32-lo) 0, implicit-def dead %scc, implicit %scc
+
+ %vgpr10 = COPY killed %sgpr14, implicit %exec
+ %vgpr11 = COPY killed %sgpr15, implicit %exec
+
+ FLAT_STORE_DWORDX4 %vgpr10_vgpr11, %vgpr4_vgpr5_vgpr6_vgpr7, 0, 0, 0, implicit %exec, implicit %flat_scr
+...
OpenPOWER on IntegriCloud