[llvm] [RISCV] Add isel patterns for generating Xqcibi branch instructions (PR #139872)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 13:53:54 PDT 2025


================
@@ -188,6 +188,36 @@ def AddLike: PatFrags<(ops node:$A, node:$B),
 def AddShl : PatFrag<(ops node:$Ra, node:$Rb, node:$SH3),
                      (add node:$Ra, (shl node:$Rb, node:$SH3))>;
 
+def IntCCtoQCRISCVCC : SDNodeXForm<riscv_selectcc, [{
+  ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
+  int64_t Imm = dyn_cast<ConstantSDNode>(N->getOperand(1))->getSExtValue();
----------------
topperc wrote:

`dyn_cast` returns null on failure. If it can't fail, use `cast`.

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


More information about the llvm-commits mailing list