This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by piggynl on Aug 5 2022, 2:05 AM.

Details

Reviewers
None
Summary

Parameter BrOffset in TargetInstrInfo::insertIndirectBranch() is initially added in rG6bc43d8627ca44465e7ce261a0828b70d3460e13 to tell whether the inserted branch is a forward branch or a backward branch. The conditional has been removed in 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.

Diff Detail

Event Timeline

piggynl created this revision.Aug 5 2022, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 2:05 AM
piggynl requested review of this revision.Aug 5 2022, 2:05 AM
piggynl abandoned this revision.Aug 5 2022, 4:58 AM