From 38bdfc69cbe370ce5f623df4449afa32cda97422 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 18 Oct 2009 19:58:47 +0000 Subject: Spill slots cannot alias. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84432 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PseudoSourceValue.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/PseudoSourceValue.cpp') diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp index 289a52b62a..70e864050a 100644 --- a/lib/CodeGen/PseudoSourceValue.cpp +++ b/lib/CodeGen/PseudoSourceValue.cpp @@ -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); } -- cgit v1.2.3-18-g5258