summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-06-30 00:33:44 +0000
committerMatthias Braun <matze@braunis.de>2015-06-30 00:33:44 +0000
commitbd23647379440b0c0edd2d6e694934c71f7002f9 (patch)
tree2c1900656bae72de2c449dea02336c5e33dde997 /llvm/test/CodeGen
parenta7ad09d0be070fc8e1e7a8dbf9f96d234e12fbf6 (diff)
downloadbcm5719-llvm-bd23647379440b0c0edd2d6e694934c71f7002f9.tar.gz
bcm5719-llvm-bd23647379440b0c0edd2d6e694934c71f7002f9.zip
RegisterCoalescer: Cleanup empty subranges after shrinkToUses()
A call to removeEmptySubranges() is necessary after every operation that potentially removes all segments from a subregister range; this case in the register coalescer was missing. llvm-svn: 241027
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll b/llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
new file mode 100644
index 00000000000..e023a622984
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
@@ -0,0 +1,20 @@
+; RUN: llc -march=amdgcn -mcpu=SI -o /dev/null %s
+; Don't crash when the use of an undefined value is only detected by the
+; register coalescer because it is hidden with subregister insert/extract.
+target triple="amdgcn--"
+
+define void @foobar(float %a0, float %a1, float addrspace(1)* %out) nounwind {
+entry:
+ %v0 = insertelement <4 x float> undef, float %a0, i32 0
+ br i1 undef, label %ift, label %ife
+
+ift:
+ %v1 = insertelement <4 x float> undef, float %a1, i32 0
+ br label %ife
+
+ife:
+ %val = phi <4 x float> [ %v1, %ift ], [ %v0, %entry ]
+ %v2 = extractelement <4 x float> %val, i32 1
+ store float %v2, float addrspace(1)* %out, align 4
+ ret void
+}
OpenPOWER on IntegriCloud