[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 09:50:36 PDT 2025
================
@@ -4462,6 +4462,16 @@ class TargetLowering : public TargetLoweringBase {
return false;
}
+ /// Return true if it is profitable to hoist a LogicOp where both operands
+ /// have the same extension op. This transformation may not be desirable if
+ /// it disrupts a particularly auspicious target-specific tree (e.g.
+ /// (or disjoint (zext A), (zext B)) -> vwaddu.vv on RISC-V). By default it
+ /// returns true.
+ virtual bool isDesirableToHoistLogicOpWithExt(const SDNode *LogicOp,
+ unsigned ExtOp) const {
+ return true;
+ }
----------------
lukel97 wrote:
See #136716
https://github.com/llvm/llvm-project/pull/136677
More information about the llvm-commits
mailing list