Page MenuHomePhabricator

[llvm][CodeGen] Check for memory instructions when querying for alias status

Authored by Kayjukh on Apr 24 2020, 12:06 PM.



Add a check to make sure that MachineInstr::mayAlias returns prematurely if at least one of its instruction parameters does not access memory. This prevents calls to TargetInstrInfo::areMemAccessesTriviallyDisjoint with incompatible instructions.

A side effect of this change is to render the mayAlias helper in the AArch64 load/store optimizer obsolete. We can now directly call the MachineInstr::mayAlias member function.

Diff Detail

Event Timeline

Kayjukh created this revision.Apr 24 2020, 12:06 PM

Is this fixing a visible bug? Or is it just a cleanup?

It is just a cleanup. I ran into an issue related to this missing check in an out-of-tree project.

This revision is now accepted and ready to land.Apr 24 2020, 1:39 PM
This revision was automatically updated to reflect the committed changes.