From: Chris Lattner Date: Sun, 30 Aug 2009 22:14:17 +0000 (+0000) Subject: rename test X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0665552c615547d8e26cf0473a6adaded3af1bbf;p=oota-llvm.git rename test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80523 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll b/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll deleted file mode 100644 index 821c8a3fd5b..00000000000 --- a/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll +++ /dev/null @@ -1,50 +0,0 @@ -; RUN: llvm-as < %s | opt -licm | llvm-dis | FileCheck %s - -@X = global i32 0 ; [#uses=1] - -declare void @foo() - -; This testcase tests for a problem where LICM hoists -; potentially trapping instructions when they are not guaranteed to execute. -define i32 @test1(i1 %c) { -; CHECK: @test1 - %A = load i32* @X ; [#uses=2] - br label %Loop -Loop: ; preds = %LoopTail, %0 - call void @foo( ) - br i1 %c, label %LoopTail, label %IfUnEqual - -IfUnEqual: ; preds = %Loop -; CHECK: IfUnEqual: -; CHECK-NEXT: sdiv i32 4, %A - %B1 = sdiv i32 4, %A ; [#uses=1] - br label %LoopTail - -LoopTail: ; preds = %IfUnEqual, %Loop - %B = phi i32 [ 0, %Loop ], [ %B1, %IfUnEqual ] ; [#uses=1] - br i1 %c, label %Loop, label %Out -Out: ; preds = %LoopTail - %C = sub i32 %A, %B ; [#uses=1] - ret i32 %C -} - - -declare void @foo2(i32) - - -;; It is ok and desirable to hoist this potentially trapping instruction. -define i32 @test2(i1 %c) { -; CHECK: @test2 -; CHECK-NEXT: load i32* @X -; CHECK-NEXT: %B = sdiv i32 4, %A - %A = load i32* @X ; [#uses=2] - br label %Loop -Loop: - ;; Should have hoisted this div! - %B = sdiv i32 4, %A ; [#uses=2] - call void @foo2( i32 %B ) - br i1 %c, label %Loop, label %Out -Out: ; preds = %Loop - %C = sub i32 %A, %B ; [#uses=1] - ret i32 %C -} diff --git a/test/Transforms/LICM/hoisting.ll b/test/Transforms/LICM/hoisting.ll new file mode 100644 index 00000000000..821c8a3fd5b --- /dev/null +++ b/test/Transforms/LICM/hoisting.ll @@ -0,0 +1,50 @@ +; RUN: llvm-as < %s | opt -licm | llvm-dis | FileCheck %s + +@X = global i32 0 ; [#uses=1] + +declare void @foo() + +; This testcase tests for a problem where LICM hoists +; potentially trapping instructions when they are not guaranteed to execute. +define i32 @test1(i1 %c) { +; CHECK: @test1 + %A = load i32* @X ; [#uses=2] + br label %Loop +Loop: ; preds = %LoopTail, %0 + call void @foo( ) + br i1 %c, label %LoopTail, label %IfUnEqual + +IfUnEqual: ; preds = %Loop +; CHECK: IfUnEqual: +; CHECK-NEXT: sdiv i32 4, %A + %B1 = sdiv i32 4, %A ; [#uses=1] + br label %LoopTail + +LoopTail: ; preds = %IfUnEqual, %Loop + %B = phi i32 [ 0, %Loop ], [ %B1, %IfUnEqual ] ; [#uses=1] + br i1 %c, label %Loop, label %Out +Out: ; preds = %LoopTail + %C = sub i32 %A, %B ; [#uses=1] + ret i32 %C +} + + +declare void @foo2(i32) + + +;; It is ok and desirable to hoist this potentially trapping instruction. +define i32 @test2(i1 %c) { +; CHECK: @test2 +; CHECK-NEXT: load i32* @X +; CHECK-NEXT: %B = sdiv i32 4, %A + %A = load i32* @X ; [#uses=2] + br label %Loop +Loop: + ;; Should have hoisted this div! + %B = sdiv i32 4, %A ; [#uses=2] + call void @foo2( i32 %B ) + br i1 %c, label %Loop, label %Out +Out: ; preds = %Loop + %C = sub i32 %A, %B ; [#uses=1] + ret i32 %C +}