[PATCH] D75915: [GlobalISel] combine G_TRUNC with G_MERGE_VALUES

Dominik Montada via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 06:29:58 PDT 2020


gargaroff marked 3 inline comments as done.
gargaroff added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-trunc.mir:98
+    $vgpr0 = COPY %4
+...
----------------
arsenm wrote:
> Should add some cases with pointers to catch the isScalar checks
I already had a test for merging pointers to a scalar. Since G_TRUNC cannot work on pointers there is no point in having a merge from scalars to pointers, as this would require a G_PTRTOINT cast, which would not trigger this combine rule in the first place.

I therefore simply added the three cases (trunc size < merge source size, >, ==) with pointer inputs and check that they do not get combined. I hope that's enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75915





More information about the llvm-commits mailing list