From 0bee3f44ca0cd63bb1fbfeff5184e9ca30363ebe Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 15 Jun 2007 17:54:05 +0000 Subject: [PATCH] Add a testcase where GVNPRE what getting confused by a loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37594 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/GVNPRE/2007-06-15-Looping.ll | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/Transforms/GVNPRE/2007-06-15-Looping.ll diff --git a/test/Transforms/GVNPRE/2007-06-15-Looping.ll b/test/Transforms/GVNPRE/2007-06-15-Looping.ll new file mode 100644 index 00000000000..92d2288f896 --- /dev/null +++ b/test/Transforms/GVNPRE/2007-06-15-Looping.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | opt -gvnpre | llvm-dis + +define fastcc void @compute_max_score_1() { +entry: + %tmp7 = sub i32 0, 0 ; [#uses=0] + br label %bb + +bb: ; preds = %bb212, %entry + %indvar29 = phi i32 [ 0, %entry ], [ %indvar.next30, %bb212 ] ; [#uses=2] + %j.01.0 = sub i32 %indvar29, 0 ; [#uses=0] + br label %cond_next166 + +cond_next166: ; preds = %cond_next166, %bb + br i1 false, label %bb212, label %cond_next166 + +bb212: ; preds = %cond_next166 + %indvar.next30 = add i32 %indvar29, 1 ; [#uses=1] + br i1 false, label %return, label %bb + +return: ; preds = %bb212 + ret void +} -- 2.34.1