Simplify landing pad lowering.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 4 Jul 2013 04:53:45 +0000 (04:53 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 4 Jul 2013 04:53:45 +0000 (04:53 +0000)
commitfee2a202098641b6d8e35fad369c72b5da7f5774
treebce524813b45a50761734c63311f61fe622ba512
parent3d8560c382f6d422737e57c32737e7379fefa184
Simplify landing pad lowering.

Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be  scheduled at the top of the
basic block.

This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.

This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.

A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.

llvm-svn: 185617
llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp