Skip to content

Commit a680c55

Browse files
committed
[ARM] Remove unused class member in ARMConstantIslandPass
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 0d46400 commit a680c55

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
@@ -523,7 +520,6 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &mf) {
523520
CPEntries.clear();
524521
JumpTableEntryIndices.clear();
525522
JumpTableUserIndices.clear();
526-
BlockJumpTableRefCount.clear();
527523
ImmBranches.clear();
528524
PushPopMIs.clear();
529525
T2JumpTables.clear();
@@ -736,14 +732,6 @@ Align ARMConstantIslands::getCPEAlign(const MachineInstr *CPEMI) {
736732
return MCP->getConstants()[CPI].getAlign();
737733
}
738734

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

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

0 commit comments

Comments
 (0)