[llvm] [DAGCombiner] Add support for scalarising extracts of a vector setcc (PR #116031)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 01:21:30 PST 2024


================
@@ -3334,6 +3334,10 @@ class TargetLoweringBase {
     return false;
   }
 
+  /// Try to convert an extract element of a vector setcc operation into an
+  /// extract element followed by a scalar operation.
+  virtual bool shouldScalarizeSetCC(SDValue VecOp) const { return false; }
----------------
david-arm wrote:

Hmm, perhaps I didn't understand your comment. Are you implying that I can simply reuse `shouldScalarizeBinOp` and check the opcode of `VecOp` instead of adding an extra hook just for setcc? If so, then I'm happy to do that - it just requires modifying all existing `shouldScalarizeBinOp` hooks to bail out for the setcc case.

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


More information about the llvm-commits mailing list