[llvm] [RISCV] Add branch+c.mv macrofusion for sifive-p450. (PR #76169)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 11:10:39 PST 2023


================
@@ -6908,7 +6908,8 @@ static SDValue combineSelectToBinOp(SDNode *N, SelectionDAG &DAG,
   MVT VT = N->getSimpleValueType(0);
   SDLoc DL(N);
 
-  if (!Subtarget.hasShortForwardBranchOpt()) {
+  if (!Subtarget.hasShortForwardBranchOpt() &&
----------------
topperc wrote:

Actually its more complicated because ShortForwardBranch can fuse `mv` or `c.mv` but CMOVBranchOpt requires C. So I don't think the dependency alone would be enough, but we could have a single subtarget function to wrap this.

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


More information about the llvm-commits mailing list