Skip to content

Commit 1d5bf04

Browse files
authored
[ARM] Remove unused class member in ARMConstantIslandPass (#141093)
The map variable `BlockJumpTableRefCount` was added in commit f5f28d5 to track whether a basic block was the target of any jump table entries. This was used in the function `fixupBTI` to insert and remove BTIs after jump tables had been modified. Commit 3b74224 removed `fixupBTI` on the grounds that the work was now being done elsewhere. That left `BlockJumpTableRefCount` still being created, but now nothing is using it. So we can garbage-collect that variable and all the code that populates it.
1 parent ee9294f commit 1d5bf04

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ namespace {
183183
/// base address.
184184
DenseMap<int, int> JumpTableUserIndices;
185185

186-
// Maps a MachineBasicBlock to the number of jump tables entries.
187-
DenseMap<const MachineBasicBlock *, int> BlockJumpTableRefCount;
188-
189186
/// ImmBranch - One per immediate branch, keeping the machine instruction
190187
/// pointer, conditional or unconditional, the max displacement,
191188
/// and (if isCond is true) the corresponding unconditional branch
@@ -522,7 +519,6 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &mf) {
522519
CPEntries.clear();
523520
JumpTableEntryIndices.clear();
524521
JumpTableUserIndices.clear();
525-
BlockJumpTableRefCount.clear();
526522
ImmBranches.clear();
527523
PushPopMIs.clear();
528524
T2JumpTables.clear();
@@ -735,14 +731,6 @@ Align ARMConstantIslands::getCPEAlign(const MachineInstr *CPEMI) {
735731
return MCP->getConstants()[CPI].getAlign();
736732
}
737733

738-
// Exception landing pads, blocks that has their adress taken, and function
739-
// entry blocks will always be (potential) indirect jump targets, regardless of
740-
// whether they are referenced by or not by jump tables.
741-
static bool isAlwaysIndirectTarget(const MachineBasicBlock &MBB) {
742-
return MBB.isEHPad() || MBB.hasAddressTaken() ||
743-
&MBB == &MBB.getParent()->front();
744-
}
745-
746734
/// scanFunctionJumpTables - Do a scan of the function, building up
747735
/// information about the sizes of each block and the locations of all
748736
/// the jump tables.
@@ -753,20 +741,6 @@ void ARMConstantIslands::scanFunctionJumpTables() {
753741
(I.getOpcode() == ARM::t2BR_JT || I.getOpcode() == ARM::tBR_JTr))
754742
T2JumpTables.push_back(&I);
755743
}
756-
757-
if (!MF->getInfo<ARMFunctionInfo>()->branchTargetEnforcement())
758-
return;
759-
760-
if (const MachineJumpTableInfo *JTI = MF->getJumpTableInfo())
761-
for (const MachineJumpTableEntry &JTE : JTI->getJumpTables())
762-
for (const MachineBasicBlock *MBB : JTE.MBBs) {
763-
if (isAlwaysIndirectTarget(*MBB))
764-
// Set the reference count essentially to infinity, it will never
765-
// reach zero and the BTI Instruction will never be removed.
766-
BlockJumpTableRefCount[MBB] = std::numeric_limits<int>::max();
767-
else
768-
++BlockJumpTableRefCount[MBB];
769-
}
770744
}
771745

772746
/// initializeFunctionInfo - Do the initial scan of the function, building up

0 commit comments

Comments
 (0)