[PATCH] D79567: [GlobalISel] Combine scalar unmerge(trunc)

Dominik Montada via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 00:31:22 PDT 2020


gargaroff closed this revision.
gargaroff marked 2 inline comments as done.
gargaroff added a comment.

052c962ced71c5130d709186b78c37a4adc59d66 <https://reviews.llvm.org/rG052c962ced71c5130d709186b78c37a4adc59d66>



================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h:356-366
+    if (CastOpc == TargetOpcode::G_TRUNC) {
+      if (SrcTy.isVector() && SrcTy.getScalarType() == DestTy.getScalarType()) {
+        //  %1:_(<4 x s8>) = G_TRUNC %0(<4 x s32>)
+        //  %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8) = G_UNMERGE_VALUES %1
+        // =>
+        //  %6:_(s32), %7:_(s32), %8:_(s32), %9:_(s32) = G_UNMERGE_VALUES %0
+        //  %2:_(s8) = G_TRUNC %6
----------------
arsenm wrote:
> I think the diff is messed up and includes one of my recent patches now. I'm assuming much of this will disappear in the final version?
Kind-of. I extracted both of our code to a new function to keep the code more readable in `tryCombineMerges` and to make it more easy to add other merge-cast combines, which is why most of it appears in this diff now. I'm going to land that as a separate commit though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79567





More information about the llvm-commits mailing list