From 1d1b3c49531bb80bcd28870d4eafb71d97049e02 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Mon, 27 Mar 2023 16:10:48 +0200 Subject: [PATCH] [RISCV] Remove isCall instruction flag from JAL/JALR As far as I can tell, the instruction flags set in the various RISCVInstrInfo*.td files are always under-approximations. That is, something like isTerminator will only be set for opcodes that are *always* terminators. The exception seems to be isCall; this is set for JAL/JALR while these instruction are not always calls. This patch proposes to remove isCall from JAL/JALR for consistency. A follow-up patch will add more detailed analysis of some instruction properties based on MCInstrAnalysis. Reviewed By: asb, craig.topper Differential Revision: https://reviews.llvm.org/D146437 --- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 2 -- 1 file changed, 2 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td index 70f5622..bddafd2 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.td @@ -620,11 +620,9 @@ def LUI : RVInstU, Sched<[WriteIALU]>; -let isCall = 1 in def JAL : RVInstJ, Sched<[WriteJal]>; -let isCall = 1 in def JALR : RVInstI<0b000, OPC_JALR, (outs GPR:$rd), (ins GPR:$rs1, simm12:$imm12), "jalr", "$rd, ${imm12}(${rs1})">, -- 2.7.4