summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-11-01 23:50:04 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-11-01 23:50:04 +0000
commitf57b1baa441e3bbce7f264d8bb5054e50fe8ee1c (patch)
tree94b19cfc74b5db489a2143b3180459f4e374f7c4 /lib/CodeGen/PseudoSourceValue.cpp
parentf4e748bc3f7090468f7b7e5b6e2ebe323c1e16fd (diff)
downloadllvm-f57b1baa441e3bbce7f264d8bb5054e50fe8ee1c.tar.gz
llvm-f57b1baa441e3bbce7f264d8bb5054e50fe8ee1c.tar.bz2
llvm-f57b1baa441e3bbce7f264d8bb5054e50fe8ee1c.tar.xz
Add PseudoSourceValue::mayAlias. It returns true if the object can ever alias any LLVM IR value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--lib/CodeGen/PseudoSourceValue.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp
index 1875cc78f5..5507646878 100644
--- a/lib/CodeGen/PseudoSourceValue.cpp
+++ b/lib/CodeGen/PseudoSourceValue.cpp
@@ -64,6 +64,8 @@ namespace {
virtual bool isAliased(const MachineFrameInfo *MFI) const;
+ virtual bool mayAlias(const MachineFrameInfo *) const;
+
virtual void printCustom(raw_ostream &OS) const {
OS << "FixedStack" << FI;
}
@@ -100,6 +102,14 @@ bool PseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
return true;
}
+bool PseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const {
+ if (this == getGOT() ||
+ this == getConstantPool() ||
+ this == getJumpTable())
+ return false;
+ return true;
+}
+
bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{
return MFI && MFI->isImmutableObjectIndex(FI);
}
@@ -113,3 +123,10 @@ bool FixedStackPseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
// Spill slots should not alias others.
return !MFI->isFixedObjectIndex(FI) && !MFI->isSpillSlotObjectIndex(FI);
}
+
+bool FixedStackPseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const {
+ if (!MFI)
+ return true;
+ // Spill slots will not alias any LLVM IR value.
+ return !MFI->isSpillSlotObjectIndex(FI);
+}