[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 Nov 3 07:49:04 PST 2020


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:1599
+    }
+    // Arithmetic shift and saturating signed left or right shift have no effect
+    // beyond scalar size.
----------------
I think you mean "saturating signed or unsigned left shift" here.

But this does not work for saturating unsigned left shift. There is no good replacement for "x ushlsat 20 ushlsat 25" where 20 + 25 exceeds the width of the type. I suggest catching this case in the match func and returning false.


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

https://reviews.llvm.org/D90217



More information about the llvm-commits mailing list