summaryrefslogtreecommitdiff
path: root/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2013-05-31 17:20:29 +0000
committerQuentin Colombet <qcolombet@apple.com>2013-05-31 17:20:29 +0000
commit5b00f4edcbebad3b5474e3052b6d30ceb5d68e88 (patch)
tree25e7625de4948f18d1b1ec8d0584b674f185b52b /test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
parentbed23081860275c79137f65d592920e7991b8198 (diff)
downloadllvm-5b00f4edcbebad3b5474e3052b6d30ceb5d68e88.tar.gz
llvm-5b00f4edcbebad3b5474e3052b6d30ceb5d68e88.tar.bz2
llvm-5b00f4edcbebad3b5474e3052b6d30ceb5d68e88.tar.xz
Modify how the formulae are rated in Loop Strength Reduce.
Namely, check if the target allows to fold more that one register in the addressing mode and if yes, adjust the cost accordingly. Prior to this commit, reg1 + scale * reg2 accesses were artificially preferred to reg1 + reg2 accesses. Indeed, the cost model wrongly assumed that reg1 + reg2 needs a temporary register for the computation, whereas it was correctly estimated for reg1 + scale * reg2. <rdar://problem/13973908> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll')
-rw-r--r--test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
index 8fbddf8ae4..652eb06225 100644
--- a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
+++ b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll
@@ -10,12 +10,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; Verify that nothing uses the "dead" ptrtoint from "undef".
; CHECK: @VerifyDiagnosticConsumerTest
; CHECK: bb:
-; CHECK: %0 = ptrtoint i8* undef to i64
-; CHECK-NOT: %0
+; "dead" ptrpoint not emitted (or dead code eliminated) with
+; current LSR cost model.
+; CHECK-NOT: = ptrtoint i8* undef to i64
; CHECK: .lr.ph
-; CHECK-NOT: %0
-; CHECK: sub i64 %7, %tmp6
-; CHECK-NOT: %0
+; CHECK: [[TMP:%[^ ]+]] = add i64 %tmp5, 1
+; CHECK: sub i64 [[TMP]], %tmp6
; CHECK: ret void
define void @VerifyDiagnosticConsumerTest() unnamed_addr nounwind uwtable align 2 {
bb: