[llvm-commits] [llvm] r80523 - in /llvm/trunk/test/Transforms/LICM: 2003-08-04-TrappingInstHoist.ll hoisting.ll

Chris Lattner sabre at nondot.org
Sun Aug 30 15:14:17 PDT 2009


Author: lattner
Date: Sun Aug 30 17:14:17 2009
New Revision: 80523

URL: http://llvm.org/viewvc/llvm-project?rev=80523&view=rev
Log:
rename test

Added:
    llvm/trunk/test/Transforms/LICM/hoisting.ll
      - copied unchanged from r80522, llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll
Removed:
    llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll

Removed: llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll?rev=80522&view=auto

==============================================================================
--- llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll (original)
+++ llvm/trunk/test/Transforms/LICM/2003-08-04-TrappingInstHoist.ll (removed)
@@ -1,50 +0,0 @@
-; RUN: llvm-as < %s | opt -licm | llvm-dis | FileCheck %s
-
- at X = global i32 0		; <i32*> [#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		; <i32> [#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		; <i32> [#uses=1]
-	br label %LoopTail
-        
-LoopTail:		; preds = %IfUnEqual, %Loop
-	%B = phi i32 [ 0, %Loop ], [ %B1, %IfUnEqual ]		; <i32> [#uses=1]
-	br i1 %c, label %Loop, label %Out
-Out:		; preds = %LoopTail
-	%C = sub i32 %A, %B		; <i32> [#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		; <i32> [#uses=2]
-	br label %Loop
-Loop:
-        ;; Should have hoisted this div!
-	%B = sdiv i32 4, %A		; <i32> [#uses=2]
-	call void @foo2( i32 %B )
-	br i1 %c, label %Loop, label %Out
-Out:		; preds = %Loop
-	%C = sub i32 %A, %B		; <i32> [#uses=1]
-	ret i32 %C
-}





More information about the llvm-commits mailing list