[PATCH] D80161: [CodeGen] Add support for multiple memory operands in MachineInstr::mayAlias
Jean-Michel Gorius via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 19 04:49:49 PDT 2020
Kayjukh marked an inline comment as done.
Kayjukh added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineInstr.cpp:1280
+ int64_t LowWidth = (MinOffset == OffsetA) ? WidthA : WidthB;
+ return (MinOffset + LowWidth > MaxOffset);
+ }
----------------
dmgreen wrote:
> Kayjukh wrote:
> > dmgreen wrote:
> > > It would seem incorrect to return false here now? Same for the pseudo values above.
> > Yes, we should only return if the result is true. For the pseudo-values I guess we can just skip the checks entirely and only update the value of `SameVal`.
> > It leads to more test cases failing because of instruction ordering. I will update the diff as soon as I fixed all of these.
> If the code before worked with two mmo's, would it be possible to do something like:
> auto HasAlias = [](MMOa, MMOb) {
> old code as it was before return true/false;
> };
>
> for (auto &MMOa : memoperands()) {
> for (auto &MMOb : Other.memoperands()) {
> if (HasAlias(MMOa, MMOb))
> return true;
> return false;
It would definitely make things clearer. Thanks for your suggestion!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80161/new/
https://reviews.llvm.org/D80161
More information about the llvm-commits
mailing list