From 386e26b0e33c6e142e2a456ae670ddc1c2e168a1 Mon Sep 17 00:00:00 2001 From: Wojciech Matyjewicz Date: Sun, 15 Jun 2008 19:07:39 +0000 Subject: Fix PR2434. When scanning for exising binary operator to reuse don't take into account the instrucion pointed by InsertPt. Thanks to it, returning the new value of InsertPt to the InsertBinop() caller can be avoided. The bug was, actually, in visitAddRecExpr() method which wasn't correctly handling changes of InsertPt. There shouldn't be any performance regression, as -gvn pass (run after -indvars) removes any redundant binops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52291 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll (limited to 'test') diff --git a/test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll b/test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll new file mode 100644 index 0000000..aac8d97 --- /dev/null +++ b/test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | opt -indvars -disable-output +; PR2434 + +define fastcc void @regcppop() nounwind { +entry: + %tmp61 = add i32 0, -5 ; [#uses=1] + br label %bb + +bb: ; preds = %bb, %entry + %PL_savestack_ix.tmp.0 = phi i32 [ %tmp61, %entry ], [ %tmp127, %bb ] ; [#uses=2] + %indvar10 = phi i32 [ 0, %entry ], [ %indvar.next11, %bb ] ; [#uses=2] + %tmp13 = mul i32 %indvar10, -4 ; [#uses=0] + %tmp111 = add i32 %PL_savestack_ix.tmp.0, -3 ; [#uses=0] + %tmp127 = add i32 %PL_savestack_ix.tmp.0, -4 ; [#uses=1] + %indvar.next11 = add i32 %indvar10, 1 ; [#uses=1] + br label %bb +} -- cgit v1.1