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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 07:37:40 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) &&
----------------
lukel97 wrote:

Actually it looks like the other opcodes are VL nodes so I think I've convinced myself that's fine. Maybe we should just rename that to VectorNodeExtensionHelper or something

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


More information about the llvm-commits mailing list