Spill slots cannot alias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2009-10-18 19:58:47 +00:00
parent d36076e4a3
commit 38bdfc69cb
4 changed files with 17 additions and 10 deletions

View File

@ -63,7 +63,7 @@ namespace {
virtual bool isConstant(const MachineFrameInfo *MFI) const;
virtual bool isAliased() const;
virtual bool isAliased(const MachineFrameInfo *MFI) const;
virtual void printCustom(raw_ostream &OS) const {
OS << "FixedStack" << FI;
@ -91,7 +91,7 @@ bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const {
return false;
}
bool PseudoSourceValue::isAliased() const {
bool PseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
if (this == getStack() ||
this == getGOT() ||
this == getConstantPool() ||
@ -105,9 +105,12 @@ bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{
return MFI && MFI->isImmutableObjectIndex(FI);
}
bool FixedStackPseudoSourceValue::isAliased() const{
bool FixedStackPseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
// Negative frame indices are used for special things that don't
// appear in LLVM IR. Non-negative indices may be used for things
// like static allocas.
return FI >= 0;
if (!MFI)
return FI >= 0;
// Spill slots should not alias others.
return !MFI->isFixedObjectIndex(FI) && !MFI->isSpillSlotObjectIndex(FI);
}