[llvm] [AArch64][SVE2] Do not emit RSHRNB for large shifts (PR #66672)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 05:07:54 PDT 2023


================
@@ -20241,6 +20241,9 @@ static SDValue trySimplifySrlAddToRshrnb(SDValue Srl, SelectionDAG &DAG,
     return SDValue();
   unsigned ShiftValue = SrlOp1->getZExtValue();
 
+  if (ShiftValue > ResVT.getScalarSizeInBits())
----------------
MDevereau wrote:

@david-arm zero shifts get nuked out of existence really early on by other passes so I'm skeptical this isn't just slowing down the transform. That being said I'll add a test with a 0 shift just to assert it's being correctly removed. From what I can see as well, it isn't possible for SVE shifts to emit if the shift amount is 0. So even if this code bailed on a zero shift, it wouldn't be valid code anyway.

https://github.com/llvm/llvm-project/pull/66672


More information about the llvm-commits mailing list