[PATCH] D90217: [AMDGPU][GlobalISel] Fold a chain of two shift instructions with constant operands

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 07:06:36 PDT 2020


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1590
+  if (Imm >= Ty.getScalarSizeInBits()) {
+    // Any logical shift that exceeds scalar size will produce zero.
+    if (Opcode != TargetOpcode::G_ASHR) {
----------------
arsenm wrote:
> This is undefined, not 0. I don't think this needs to specially consider this case
No, this is handling cases like X >> 20 >> 25 where the sum (20 + 25) exceeds the width of the type.


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

https://reviews.llvm.org/D90217



More information about the llvm-commits mailing list