summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/hoist_instr.ll
blob: cfe704d56934124d65ee1018753d3f1966fe8191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN:   %prcontext div 1 | grep then:

;; This tests that the div is hoisted into the then block.

int %foo(bool %C, int %A, int %B) {
entry:
	br bool %C, label %then, label %endif

then:
	br label %endif

endif:
	%X = phi int [%A, %then], [15, %entry]
	%Y = div int %X, 42
	ret int %Y
}