summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-10-18 19:58:47 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-10-18 19:58:47 +0000
commitf0236e011e599177a84b5744c4eff48c3c05911a (patch)
tree3630a3b7a05645682cb6caadf2d4b1c6627d059c /llvm/lib/CodeGen/PseudoSourceValue.cpp
parentc436631a9cb3c07ffc82eed189b3df5b2203a0f4 (diff)
downloadbcm5719-llvm-f0236e011e599177a84b5744c4eff48c3c05911a.tar.gz
bcm5719-llvm-f0236e011e599177a84b5744c4eff48c3c05911a.zip
Spill slots cannot alias.
llvm-svn: 84432
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--llvm/lib/CodeGen/PseudoSourceValue.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp
index 289a52b62a9..70e864050a6 100644
--- a/llvm/lib/CodeGen/PseudoSourceValue.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud