[RISCV] Remove is*Branch instruction flags from C_JR
authorJob Noorman <jnoorman@igalia.com>
Tue, 11 Apr 2023 07:28:18 +0000 (09:28 +0200)
committerJob Noorman <jnoorman@igalia.com>
Tue, 11 Apr 2023 07:28:18 +0000 (09:28 +0200)
As discussed in 1d1b3c49531b, instruction flags set in the *.td files
are under-approximations. For C_JR, isBranch and isConditionalBranch are
set even though it is used for for returns which are not considered
branches.

This patch proposes to remove those flags from C_JR. More detailed
analysis can be implemented in RISCVMCInstrAnalysis.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D147784

llvm/lib/Target/RISCV/RISCVInstrInfoC.td

index 91aaa43..a26d791 100644 (file)
@@ -552,10 +552,8 @@ def C_LDSP : CStackLoad<0b011, "c.ldsp", GPRNoX0, uimm9_lsb000>,
 let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
 def C_JR : RVInst16CR<0b1000, 0b10, (outs), (ins GPRNoX0:$rs1),
                       "c.jr", "$rs1">, Sched<[WriteJmpReg]> {
-  let isBranch = 1;
   let isBarrier = 1;
   let isTerminator = 1;
-  let isIndirectBranch = 1;
   let rs2 = 0;
 }