[llvm] [AArch64] Optimize two large shifts and a combine into a single combine and shift (PR #99480)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 10:56:17 PDT 2024


================
@@ -14198,9 +14198,43 @@ SDValue AArch64TargetLowering::LowerCONCAT_VECTORS(SDValue Op,
                                    !Subtarget->isNeonAvailable()))
     return LowerFixedLengthConcatVectorsToSVE(Op, DAG);
 
-  assert(Op.getValueType().isScalableVector() &&
-         isTypeLegal(Op.getValueType()) &&
-         "Expected legal scalable vector type!");
+  if (!Op.getValueType().isScalableVector()) {
+    const SDValue Trunc1 = Op.getOperand(0);
+    const SDValue Trunc2 = Op.getOperand(1);
+
+    if (Trunc1->getOpcode() == ISD::TRUNCATE &&
+        Trunc2->getOpcode() == ISD::TRUNCATE) {
----------------
sopyb wrote:

I used to have a if statement to check that didn't think it was necessary but I will add it back in

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


More information about the llvm-commits mailing list