[PATCH] D108626: [GlobalISel] Do not generate illegal G_SEXTLOADs after legalization

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 24 08:10:55 PDT 2021


foad accepted this revision.
foad added a comment.
This revision is now accepted and ready to land.

Looks reasonable to me.



================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:727-730
+  LegalityQuery::MemDesc MMDesc;
+  MMDesc.MemoryTy = LLT::scalar(NewSizeBits);
+  MMDesc.AlignInBits = MMO.getAlign().value() * 8;
+  MMDesc.Ordering = MMO.getSuccessOrdering();
----------------
Since this code is now repeated several times in this file, I wonder if MemDesc should be constructible from an MMO, so you could write:
```
  LegalityQuery::MemDesc MMDesc(MMO);
  MMDesc.MemoryTy = /* just override the size */;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108626/new/

https://reviews.llvm.org/D108626



More information about the llvm-commits mailing list