2009-09-08 22:34:10 +00:00
|
|
|
; RUN: opt -instcombine %s -S | FileCheck %s
|
2004-12-08 23:41:16 +00:00
|
|
|
|
|
|
|
;; This tests that the instructions in the entry blocks are sunk into each
|
|
|
|
;; arm of the 'if'.
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define i32 @foo(i1 %C, i32 %A, i32 %B) {
|
2004-12-08 23:41:16 +00:00
|
|
|
entry:
|
2008-03-01 09:15:35 +00:00
|
|
|
%tmp.2 = sdiv i32 %A, %B ; <i32> [#uses=1]
|
|
|
|
%tmp.9 = add i32 %B, %A ; <i32> [#uses=1]
|
|
|
|
br i1 %C, label %then, label %endif
|
2004-12-08 23:41:16 +00:00
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
then: ; preds = %entry
|
|
|
|
ret i32 %tmp.9
|
2004-12-08 23:41:16 +00:00
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
endif: ; preds = %entry
|
2009-09-05 11:35:16 +00:00
|
|
|
; CHECK: sdiv i32
|
|
|
|
; CHECK-NEXT: ret i32
|
2008-03-01 09:15:35 +00:00
|
|
|
ret i32 %tmp.2
|
2004-12-08 23:41:16 +00:00
|
|
|
}
|
2008-03-01 09:15:35 +00:00
|
|
|
|