[llvm] [RISCV] Handle scalable ops with < EEW / 2 narrow types in combineBinOp_VLToVWBinOp_VL (PR #84158)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 22:48:23 PDT 2024


================
@@ -14112,7 +14102,9 @@ static SDValue combineBinOp_VLToVWBinOp_VL(SDNode *N,
                                            TargetLowering::DAGCombinerInfo &DCI,
                                            const RISCVSubtarget &Subtarget) {
   SelectionDAG &DAG = DCI.DAG;
-  if (DCI.isBeforeLegalize())
+  // Don't perform this until types are legalized and any legal i1 types are
+  // custom lowered to avoid introducing unselectable V{S,Z}EXT_VLs.
+  if (DCI.isBeforeLegalizeOps())
----------------
sun-jacobi wrote:

Maybe it is better for us to still check whether the op is legal. 
But as @lukel97 said, the original EEW / 2 check, which the VP intrinsics already does, could be removed, AFAIU ?

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


More information about the llvm-commits mailing list