Make the clobber analysis a bit more smart: we only are careful about

early clobbers if the clobber list contains a *register* not some thing
like {memory}, {dirflag} etc.

llvm-svn: 47457
This commit is contained in:
Chris Lattner 2008-02-21 20:54:31 +00:00
parent 9f1ed12bc4
commit 3422b673d1
1 changed files with 13 additions and 3 deletions

View File

@ -3735,9 +3735,19 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
SawEarlyClobber |= OpInfo.isEarlyClobber;
// If we see a clobber of a register, it is an early clobber.
if (OpInfo.Type == InlineAsm::isClobber &&
OpInfo.ConstraintType == TargetLowering::C_Register)
SawEarlyClobber = true;
if (!SawEarlyClobber &&
OpInfo.Type == InlineAsm::isClobber &&
OpInfo.ConstraintType == TargetLowering::C_Register) {
// Note that we want to ignore things that we don't trick here, like
// dirflag, fpsr, flags, etc.
std::pair<unsigned, const TargetRegisterClass*> PhysReg =
TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode,
OpInfo.ConstraintVT);
if (PhysReg.first || PhysReg.second) {
// This is a register we know of.
SawEarlyClobber = true;
}
}
// If this is a memory input, and if the operand is not indirect, do what we
// need to to provide an address for the memory input.