diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-11-01 23:50:04 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-11-01 23:50:04 +0000 |
commit | ea68c7c9a8ba5b791ffab2be4a554f44acef5690 (patch) | |
tree | 9a39c15e2b598e19ba89f873598b1f515afe3771 /llvm/lib/CodeGen/PseudoSourceValue.cpp | |
parent | e0856c5f405c0e233601afb3b329f87703d1e0ed (diff) | |
download | bcm5719-llvm-ea68c7c9a8ba5b791ffab2be4a554f44acef5690.tar.gz bcm5719-llvm-ea68c7c9a8ba5b791ffab2be4a554f44acef5690.zip |
Add PseudoSourceValue::mayAlias. It returns true if the object can ever alias any LLVM IR value.
llvm-svn: 85762
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PseudoSourceValue.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp index 1875cc78f58..5507646878c 100644 --- a/llvm/lib/CodeGen/PseudoSourceValue.cpp +++ b/llvm/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); +} |