forked from OSchip/llvm-project
[MachineInstr] exclude call instruction in mayAlias
we now get noAlias result for a call instruction and other load/store/call instructions if we query mayAlias. This is not right as call instruction is not with mayloadorstore, but it may alter the memory. This patch fixes this wrong alias query. Differential Revision: https://reviews.llvm.org/D87490
This commit is contained in:
parent
f05608707c
commit
ed46e84c7a
|
@ -1236,6 +1236,11 @@ bool MachineInstr::mayAlias(AAResults *AA, const MachineInstr &Other,
|
|||
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
||||
const MachineFrameInfo &MFI = MF->getFrameInfo();
|
||||
|
||||
// Execulde call instruction which may alter the memory but can not be handled
|
||||
// by this function.
|
||||
if (isCall() || Other.isCall())
|
||||
return true;
|
||||
|
||||
// If neither instruction stores to memory, they can't alias in any
|
||||
// meaningful way, even if they read from the same address.
|
||||
if (!mayStore() && !Other.mayStore())
|
||||
|
|
Loading…
Reference in New Issue