[llvm-commits] [llvm] r66976 - in /llvm/trunk: lib/CodeGen/PHIElimination.cpp lib/Transforms/Scalar/CodeGenPrepare.cpp test/CodeGen/X86/2009-03-13-PHIElimBug.ll test/CodeGen/X86/split-eh-lpad-edges.ll

Duncan Sands baldrick at free.fr
Mon Mar 16 02:03:56 PDT 2009


Hi Evan, here's another testcase.  If you compile
with -fast (to avoid critical edge splitting) then
the copy for the phi node is placed before the call,
even though the value being used is the result of
the call.  That's because your patch skips over the
definition of SrcReg while looking for the EH_LABELs.
Is it ok with you if I apply my patch?  I'm not sure
how to adjust the 2009-03-13-PHIElimBug.ll testcase
though.  I guess I can grep on the -debug output...

Ciao,

Duncan.

declare i32 @f()

define i32 @phi() {
entry:
	%a = invoke i32 @f()
			to label %cont unwind label %lpad		; <i32> [#uses=1]

cont:		; preds = %lpad, %entry
	%x = phi i32 [ %a, %entry ], [ %b, %lpad ]		; <i32> [#uses=1]
	ret i32 %x

lpad:		; preds = %entry
	%b = invoke i32 @f()
			to label %cont unwind label %lpad2		; <i32> [#uses=1]

lpad2:		; preds = %lpad
	ret i32 0
}



More information about the llvm-commits mailing list