llvm.org GIT mirror llvm / 2676f83 test / Transforms / LICM / call_sink_const_function.ll
2676f83

Tree @2676f83 (Download .tar.gz)

call_sink_const_function.ll @2676f83raw · history · blame

; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext sin 1 | grep Out: 
declare double %sin(double)
declare void %foo()

double %test(double %X) {
	br label %Loop

Loop:
	call void %foo()    ;; Unknown effects!

	%A = call double %sin(double %X)   ;; Can still hoist/sink call
	br bool true, label %Loop, label %Out

Out:
	ret double %A
}