summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2013-05-13 10:21:19 +0000
committerLang Hames <lhames@gmail.com>2013-05-13 10:21:19 +0000
commitd26c93d3a8a484c5b42f06163ae5de787f0ac276 (patch)
tree7ae10e65892092069a7dc2818de9ef0702715efd /test
parentb99052ce4a75a3eac638afcd5171903514aa28e9 (diff)
downloadexternal_llvm-d26c93d3a8a484c5b42f06163ae5de787f0ac276.zip
external_llvm-d26c93d3a8a484c5b42f06163ae5de787f0ac276.tar.gz
external_llvm-d26c93d3a8a484c5b42f06163ae5de787f0ac276.tar.bz2
Correctly preserve the input chain for potential tailcall nodes whose
return values are bitcasts. The chain had previously been being clobbered with the entry node to the dag, which sometimes caused other code in the function to be erroneously deleted when tailcall optimization kicked in. <rdar://problem/13827621> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/call-tc.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/call-tc.ll b/test/CodeGen/ARM/call-tc.ll
index 58fbbda..c7e17ea 100644
--- a/test/CodeGen/ARM/call-tc.ll
+++ b/test/CodeGen/ARM/call-tc.ll
@@ -162,3 +162,20 @@ define i32 @t9() nounwind {
declare %class.MutexLock* @_ZN9MutexLockC1Ev(%class.MutexLock*) unnamed_addr nounwind align 2
declare %class.MutexLock* @_ZN9MutexLockD1Ev(%class.MutexLock*) unnamed_addr nounwind align 2
+
+; rdar://13827621
+; Correctly preserve the input chain for the tailcall node in the bitcast case,
+; otherwise the call to floorf is lost.
+define float @libcall_tc_test2(float* nocapture %a, float %b) {
+; CHECKT2D: libcall_tc_test2:
+; CHECKT2D: blx _floorf
+; CHECKT2D: b.w _truncf
+ %1 = load float* %a, align 4
+ %call = tail call float @floorf(float %1)
+ store float %call, float* %a, align 4
+ %call1 = tail call float @truncf(float %b)
+ ret float %call1
+}
+
+declare float @floorf(float) readnone
+declare float @truncf(float) readnone