summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-04 18:25:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-04-04 18:25:36 +0000
commit299475e0c6b794e7ad138693ed0feb76f2ee62f5 (patch)
tree555a52b67d5308390e595c55b3704f2b16f1072b /llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
parentfc186358f2368835cbca56677edace5fc474f13f (diff)
downloadbcm5719-llvm-299475e0c6b794e7ad138693ed0feb76f2ee62f5.tar.gz
bcm5719-llvm-299475e0c6b794e7ad138693ed0feb76f2ee62f5.zip
Avoid high-latency false CPSR dependencies even for tMOVSi.
The Thumb2SizeReduction pass avoids false CPSR dependencies, except it still aggressively creates tMOVi8 instructions because they are so common. Avoid creating false CPSR dependencies even for tMOVi8 instructions when the the CPSR flags are known to have high latency. This allows integer computation to overlap floating point computations. Also process blocks in a reverse post-order and propagate high-latency flags to successors. <rdar://problem/13468102> llvm-svn: 178773
Diffstat (limited to 'llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll')
-rw-r--r--llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll b/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
index d98925ef8ff..c5d00a0f8a4 100644
--- a/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
+++ b/llvm/test/CodeGen/ARM/avoid-cpsr-rmw.ll
@@ -83,3 +83,34 @@ while.body:
while.end:
ret void
}
+
+; Avoid producing tMOVi8 after a high-latency flag-setting operation.
+; <rdar://problem/13468102>
+define void @t4(i32* nocapture %p, double* nocapture %q) {
+entry:
+; CHECK: t4
+; CHECK: vmrs APSR_nzcv, fpscr
+; CHECK: if.then
+; CHECK-NOT movs
+ %0 = load double* %q, align 4
+ %cmp = fcmp olt double %0, 1.000000e+01
+ %incdec.ptr1 = getelementptr inbounds i32* %p, i32 1
+ br i1 %cmp, label %if.then, label %if.else
+
+if.then:
+ store i32 7, i32* %p, align 4
+ %incdec.ptr2 = getelementptr inbounds i32* %p, i32 2
+ store i32 8, i32* %incdec.ptr1, align 4
+ store i32 9, i32* %incdec.ptr2, align 4
+ br label %if.end
+
+if.else:
+ store i32 3, i32* %p, align 4
+ %incdec.ptr5 = getelementptr inbounds i32* %p, i32 2
+ store i32 5, i32* %incdec.ptr1, align 4
+ store i32 6, i32* %incdec.ptr5, align 4
+ br label %if.end
+
+if.end:
+ ret void
+}
OpenPOWER on IntegriCloud