From 9643cca39fb9fb3b49a8912926de98acf882283c Mon Sep 17 00:00:00 2001 From: rdivacky Date: Fri, 23 Oct 2009 14:19:52 +0000 Subject: Update LLVM to r84949. --- lib/CodeGen/PseudoSourceValue.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/CodeGen/PseudoSourceValue.cpp') diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp index 00c5d46..70e8640 100644 --- a/lib/CodeGen/PseudoSourceValue.cpp +++ b/lib/CodeGen/PseudoSourceValue.cpp @@ -63,6 +63,8 @@ namespace { virtual bool isConstant(const MachineFrameInfo *MFI) const; + virtual bool isAliased(const MachineFrameInfo *MFI) const; + virtual void printCustom(raw_ostream &OS) const { OS << "FixedStack" << FI; } @@ -89,6 +91,26 @@ bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const { return false; } +bool PseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const { + if (this == getStack() || + this == getGOT() || + this == getConstantPool() || + this == getJumpTable()) + return false; + llvm_unreachable("Unknown PseudoSourceValue!"); + return true; +} + bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{ return MFI && MFI->isImmutableObjectIndex(FI); } + +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. + if (!MFI) + return FI >= 0; + // Spill slots should not alias others. + return !MFI->isFixedObjectIndex(FI) && !MFI->isSpillSlotObjectIndex(FI); +} -- cgit v1.1