[PATCH] D131249: [BranchRelaxation] Remove param BrOffset from TargetInstrInfo::insertIndirectBranch() [NFC]

Piggy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 02:05:18 PDT 2022


piggynl created this revision.
Herald added subscribers: kosarev, foad, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, nhaehnle, jvesely, dylanmckay, arsenm.
Herald added a project: All.
piggynl requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay.
Herald added a project: LLVM.

Parameter BrOffset in `TargetInstrInfo::insertIndirectBranch()` is initially added in rG6bc43d8627ca44465e7ce261a0828b70d3460e13 <https://reviews.llvm.org/rG6bc43d8627ca44465e7ce261a0828b70d3460e13> to tell whether the inserted branch is a forward branch or a backward branch. The conditional has been removed in D106445 <https://reviews.llvm.org/D106445> and BrOffset is not used in any target now. This patch removes the parameter.

Because the offset between the branch instruction and the branch target could be changed in another iteration in `BranchRelaxation::relaxBranchInstructions()`, the MachineOperand for the branch target should be an MBB instead of a fixed number, thus there shouldn't be any usage of BrOffset, so I believe removing the parameter is safe. Also, I'm trying to write a patch to deduplicate restore blocks in `BranchRelaxation::fixupUnconditionalBranch()`. Removing this parameter would avoid some unnecessary offset calculations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131249

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/BranchRelaxation.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.h
  llvm/lib/Target/AVR/AVRInstrInfo.cpp
  llvm/lib/Target/AVR/AVRInstrInfo.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131249.450254.patch
Type: text/x-patch
Size: 5444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220805/39ca565e/attachment.bin>


More information about the llvm-commits mailing list