[PATCH] D147784: [RISCV] Remove is*Branch instruction flags from C_JR

Job Noorman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 05:43:19 PDT 2023


jobnoorman created this revision.
jobnoorman added reviewers: asb, jrtc27, craig.topper, kito-cheng.
Herald added subscribers: luke, pmatos, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
jobnoorman requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

As discussed in 1d1b3c49531b <https://reviews.llvm.org/rG1d1b3c49531bb80bcd28870d4eafb71d97049e02>, 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147784

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoC.td


Index: llvm/lib/Target/RISCV/RISCVInstrInfoC.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoC.td
@@ -552,10 +552,8 @@
 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;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147784.511671.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230407/c925c85e/attachment.bin>


More information about the llvm-commits mailing list