summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-09-18 04:57:18 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-09-18 04:57:18 +0000
commit0994abda3aa6ad490bb78f50e0be99952bdd2361 (patch)
tree373c67ec0f9dd08cc75f3ba23c5a60a1ccd78dec /llvm/test/Transforms/IndVarSimplify
parentebf46143eaf7fa3ad956baf8cc876cbe2c6ae306 (diff)
downloadbcm5719-llvm-0994abda3aa6ad490bb78f50e0be99952bdd2361.tar.gz
bcm5719-llvm-0994abda3aa6ad490bb78f50e0be99952bdd2361.zip
[IndVars] Remove unreasonable checks in rewriteLoopExitValues
A piece of logic in rewriteLoopExitValues has a weird check on number of users which allowed an unprofitable transform in case if an instruction has more than 6 users. Differential Revision: https://reviews.llvm.org/D51404 Reviewed By: etherzhhb llvm-svn: 342444
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify')
-rw-r--r--llvm/test/Transforms/IndVarSimplify/dont-recompute.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll b/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
index e5ced0f2e4b..713a55154ba 100644
--- a/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
+++ b/llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
@@ -67,3 +67,33 @@ for.end: ; preds = %for.body
; CHECK-NEXT: ret i32 %add.lcssa
ret i32 %add
}
+
+; CHECK-LABEL: @test3(
+define void @test3(i32 %m) nounwind uwtable {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+ %a.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]
+ %add = add i32 %a.05, %m
+ mul i32 %add, 1
+ mul i32 %add, 1
+ mul i32 %add, 1
+ mul i32 %add, 1
+ mul i32 %add, 1
+ mul i32 %add, 1
+; CHECK: tail call void @func(i32 %add)
+ tail call void @func(i32 %add)
+ %inc = add nsw i32 %i.06, 1
+ %exitcond = icmp eq i32 %inc, 186
+ br i1 %exitcond, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+; CHECK: for.end:
+; CHECK-NOT: mul i32 %m, 186
+; CHECK:%add.lcssa = phi i32 [ %add, %for.body ]
+; CHECK-NEXT: tail call void @func(i32 %add.lcssa)
+ tail call void @func(i32 %add)
+ ret void
+}
OpenPOWER on IntegriCloud