aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
diff options
context:
space:
mode:
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>2013-05-16 23:53:29 +0000
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>2013-05-16 23:53:29 +0000
commitd6b4caf291aa8c3cd4bcb5f3b55b72621b506278 (patch)
tree335b922e8dc5dd1503c80978c946e52e009e2e9b /test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
parentdf68803890ecae2e8cfabdaa9122cb2ccbf5b89c (diff)
downloadexternal_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.zip
external_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.tar.gz
external_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.tar.bz2
[Sparc] Prevent instructions that defines or uses %o7 to be in call's delay slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SPARC/2011-01-19-DelaySlot.ll')
-rw-r--r--test/CodeGen/SPARC/2011-01-19-DelaySlot.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll b/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
index 71fdb4e..a0878d3 100644
--- a/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
+++ b/test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
@@ -87,4 +87,21 @@ entry:
ret i32 0
}
+define i32 @prevent_o7_in_call_delay_slot(i32 %i0) {
+entry:
+;CHECK: prevent_o7_in_call_delay_slot
+;CHECK: add %i0, 2, %o5
+;CHECK: add %i0, 3, %o7
+;CHECK: add %o5, %o7, %o0
+;CHECK: call bar
+;CHECK-NEXT: nop
+ %0 = add nsw i32 %i0, 2
+ %1 = add nsw i32 %i0, 3
+ tail call void asm sideeffect "", "r,r,~{l0},~{l1},~{l2},~{l3},~{l4},~{l5},~{l6},~{l7},~{i0},~{i1},~{i2},~{i3},~{i4},~{i5},~{i6},~{i7},~{o0},~{o1},~{o2},~{o3},~{o4}"(i32 %0, i32 %1)
+ %2 = add nsw i32 %0, %1
+ %3 = tail call i32 @bar(i32 %2)
+ ret i32 %3
+}
+
+
declare i32 @func(i32*)