[llvm] [RISCV] Add isel patterns for generating XAndesPerf branch immediate instructions (PR #145147)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 21:31:35 PDT 2025


================
@@ -1501,6 +1525,11 @@ bool RISCVInstrInfo::isBranchOffsetInRange(unsigned BranchOp,
   switch (BranchOp) {
   default:
     llvm_unreachable("Unexpected opcode!");
+  case RISCV::NDS_BBC:
+  case RISCV::NDS_BBS:
+  case RISCV::NDS_BEQC:
+  case RISCV::NDS_BNEC:
+    return isIntN(11, BrOffset);
----------------
topperc wrote:

Can you use `isInt<11>(BrOffset)`? Not sure why this pattern of using isIntN started, but we should use the template version and fix the rest.

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


More information about the llvm-commits mailing list