summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/coalesce-subregs.ll
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-09-19 21:29:18 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-09-19 21:29:18 +0000
commitd40d4c34f72d1eda3cd9ba0f3dbf2d43b726f06c (patch)
treee52536a598a4ccea765d0cef7d8ad86530fff015 /test/CodeGen/ARM/coalesce-subregs.ll
parentbbf628b6cefc8d817eb9ec04c2a357ad3f27d618 (diff)
downloadllvm-d40d4c34f72d1eda3cd9ba0f3dbf2d43b726f06c.tar.gz
llvm-d40d4c34f72d1eda3cd9ba0f3dbf2d43b726f06c.tar.bz2
llvm-d40d4c34f72d1eda3cd9ba0f3dbf2d43b726f06c.tar.xz
Resolve conflicts involving dead vector lanes for -new-coalescer.
A common coalescing conflict in vector code is lane insertion: %dst = FOO %src = BAR %dst:ssub0 = COPY %src The live range of %src interferes with the ssub0 lane of %dst, but that lane is never read after %src would have clobbered it. That makes it safe to merge the live ranges and eliminate the COPY: %dst = FOO %dst:ssub0 = BAR This patch teaches the new coalescer to resolve conflicts where dead vector lanes would be clobbered, at least as long as the clobbered vector lanes don't escape the basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/coalesce-subregs.ll')
-rw-r--r--test/CodeGen/ARM/coalesce-subregs.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/coalesce-subregs.ll b/test/CodeGen/ARM/coalesce-subregs.ll
index dfb5b17306..e5a88be64d 100644
--- a/test/CodeGen/ARM/coalesce-subregs.ll
+++ b/test/CodeGen/ARM/coalesce-subregs.ll
@@ -114,3 +114,30 @@ if.end: ; preds = %if.else, %if.then
}
declare void @llvm.arm.neon.vst1.v2f32(i8*, <2 x float>, i32) nounwind
+declare <2 x float> @llvm.arm.neon.vld1.v2f32(i8*, i32) nounwind readonly
+
+; CHECK: f4
+; This function inserts a lane into a fully defined vector.
+; The destination lane isn't read, so the subregs can coalesce.
+; CHECK-NOT: vmov
+; CHECK-NOT: vorr
+define void @f4(float* %p, float* %q) nounwind ssp {
+entry:
+ %0 = bitcast float* %p to i8*
+ %vld1 = tail call <2 x float> @llvm.arm.neon.vld1.v2f32(i8* %0, i32 4)
+ %tobool = icmp eq float* %q, null
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %1 = load float* %q, align 4
+ %arrayidx1 = getelementptr inbounds float* %q, i32 1
+ %2 = load float* %arrayidx1, align 4
+ %add = fadd float %1, %2
+ %vecins = insertelement <2 x float> %vld1, float %add, i32 1
+ br label %if.end
+
+if.end: ; preds = %entry, %if.then
+ %x.0 = phi <2 x float> [ %vecins, %if.then ], [ %vld1, %entry ]
+ tail call void @llvm.arm.neon.vst1.v2f32(i8* %0, <2 x float> %x.0, i32 4)
+ ret void
+}