forked from OSchip/llvm-project
Add PseudoSourceValue::mayAlias. It returns true if the object can ever alias any LLVM IR value.
llvm-svn: 85762
This commit is contained in:
parent
e0856c5f40
commit
ea68c7c9a8
|
@ -43,6 +43,10 @@ namespace llvm {
|
||||||
/// PseudoSourceValue may also be pointed to by an LLVM IR Value.
|
/// PseudoSourceValue may also be pointed to by an LLVM IR Value.
|
||||||
virtual bool isAliased(const MachineFrameInfo *) const;
|
virtual bool isAliased(const MachineFrameInfo *) const;
|
||||||
|
|
||||||
|
/// mayAlias - Return true if the memory pointed to by this
|
||||||
|
/// PseudoSourceValue can ever alias a LLVM IR Value.
|
||||||
|
virtual bool mayAlias(const MachineFrameInfo *) const;
|
||||||
|
|
||||||
/// classof - Methods for support type inquiry through isa, cast, and
|
/// classof - Methods for support type inquiry through isa, cast, and
|
||||||
/// dyn_cast:
|
/// dyn_cast:
|
||||||
///
|
///
|
||||||
|
|
|
@ -64,6 +64,8 @@ namespace {
|
||||||
|
|
||||||
virtual bool isAliased(const MachineFrameInfo *MFI) const;
|
virtual bool isAliased(const MachineFrameInfo *MFI) const;
|
||||||
|
|
||||||
|
virtual bool mayAlias(const MachineFrameInfo *) const;
|
||||||
|
|
||||||
virtual void printCustom(raw_ostream &OS) const {
|
virtual void printCustom(raw_ostream &OS) const {
|
||||||
OS << "FixedStack" << FI;
|
OS << "FixedStack" << FI;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +102,14 @@ bool PseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
|
||||||
return true;
|
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{
|
bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{
|
||||||
return MFI && MFI->isImmutableObjectIndex(FI);
|
return MFI && MFI->isImmutableObjectIndex(FI);
|
||||||
}
|
}
|
||||||
|
@ -113,3 +123,10 @@ bool FixedStackPseudoSourceValue::isAliased(const MachineFrameInfo *MFI) const {
|
||||||
// Spill slots should not alias others.
|
// Spill slots should not alias others.
|
||||||
return !MFI->isFixedObjectIndex(FI) && !MFI->isSpillSlotObjectIndex(FI);
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue