[PATCH] D96031: [GlobalISel] Combine zext(trunc x) to x

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 08:05:04 PST 2021


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

LGTM.



================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/combine-zext-trunc.mir:60-61
+    ; GCN: %low_bits:_(s64) = G_AND %var, %c3FFF
+    ; GCN: %trunc:_(s16) = G_TRUNC %low_bits(s64)
+    ; GCN: %zext:_(s32) = G_ZEXT %trunc(s16)
+    ; GCN: $vgpr0 = COPY %zext(s32)
----------------
In this case you could just use a trunc from s64 to s32. No need for the zext. That could be a follow-up though.


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

https://reviews.llvm.org/D96031



More information about the llvm-commits mailing list