diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-10-18 19:58:47 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-10-18 19:58:47 +0000 |
commit | 38bdfc69cbe370ce5f623df4449afa32cda97422 (patch) | |
tree | d38dc4ed4203ae8dcb352d90a0afa329c5c74fd3 /lib/CodeGen/PseudoSourceValue.cpp | |
parent | d36076e4a3a57f55c044cd1cf21a39abe1edf2de (diff) |
Spill slots cannot alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r-- | lib/CodeGen/PseudoSourceValue.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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); } |