[llvm] [SelectionDAG] Add an ISD node for for get.active.lane.mask (PR #139084)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue May 13 05:03:06 PDT 2025


================
@@ -5731,21 +5739,24 @@ static inline SDValue getPTrue(SelectionDAG &DAG, SDLoc DL, EVT VT,
                      DAG.getTargetConstant(Pattern, DL, MVT::i32));
 }
 
-static SDValue optimizeIncrementingWhile(SDValue Op, SelectionDAG &DAG,
+static SDValue optimizeIncrementingWhile(SDNode *N, SelectionDAG &DAG,
----------------
paulwalker-arm wrote:

Now this function is enabled for `GET_ACTIVE_LANE_MASK` you'll need a `isBeforeLegalize` bailout because otherwise it can erroneously trigger for fixed length vectors which ISD::PTRUE does not support.  You could restrict the combine to scalable vector predicate types but I also think it's better to preserve the common node for as long as possible and waiting until after legalisation before doing the conversion would tick that box as well.

FYI: When this PR lands I think I'll move the other uses into `performIntrinsicCombine` because they aren't really related to lowering.

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


More information about the llvm-commits mailing list