llvm.org GIT mirror llvm / f57b1ba
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 Evan Cheng 10 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
4242 /// PseudoSourceValue may also be pointed to by an LLVM IR Value.
4343 virtual bool isAliased(const MachineFrameInfo *) const;
4444
45 /// mayAlias - Return true if the memory pointed to by this
46 /// PseudoSourceValue can ever alias a LLVM IR Value.
47 virtual bool mayAlias(const MachineFrameInfo *) const;
48
4549 /// classof - Methods for support type inquiry through isa, cast, and
4650 /// dyn_cast:
4751 ///
6363
6464 virtual bool isAliased(const MachineFrameInfo *MFI) const;
6565
66 virtual bool mayAlias(const MachineFrameInfo *) const;
67
6668 virtual void printCustom(raw_ostream &OS) const {
6769 OS << "FixedStack" << FI;
6870 }
99101 return true;
100102 }
101103
104 bool PseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const {
105 if (this == getGOT() ||
106 this == getConstantPool() ||
107 this == getJumpTable())
108 return false;
109 return true;
110 }
111
102112 bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{
103113 return MFI && MFI->isImmutableObjectIndex(FI);
104114 }
112122 // Spill slots should not alias others.
113123 return !MFI->isFixedObjectIndex(FI) && !MFI->isSpillSlotObjectIndex(FI);
114124 }
125
126 bool FixedStackPseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const {
127 if (!MFI)
128 return true;
129 // Spill slots will not alias any LLVM IR value.
130 return !MFI->isSpillSlotObjectIndex(FI);
131 }