[llvm] [DAGCombiner][RISCV] Add target hook to decide hoisting LogicOp with extension (PR #136677)

Jim Lin via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 06:55:52 PDT 2025


================
@@ -19893,6 +19893,14 @@ bool RISCVTargetLowering::isDesirableToCommuteWithShift(
   return true;
 }
 
+bool RISCVTargetLowering::isDesirableToHoistLogicOpWithExt(
+    const SDNode *LogicOp, unsigned ExtOp) const {
+  if (NodeExtensionHelper::isSupportedRoot(LogicOp, Subtarget) &&
----------------
tclin914 wrote:

`NodeExtensionHelper::isSupportedRoot` has checked the LogicOp is or disjoint with scalable vector type. https://github.com/llvm/llvm-project/blob/3b1f46490e18614cacb688bed090cdc2fcf60d5d/llvm/lib/Target/RISCV/RISCVISelLowering.cpp#L16209


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


More information about the llvm-commits mailing list