Skip to content

Commit d7879e5

Browse files
authored
[ARM] Use DenseSet instead of DenseMap. NFC (#131978)
The value in the map is set to "true" when something is added to the map. Techncally this: if (!DefRegs.contains(Reg)) will set the value in the map to false if it didn't already exist, and this is used to indicate the value wasn't in the map. This only occurs after all the "true" values have already been added to the map.
1 parent cc2a86a commit d7879e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11366,12 +11366,12 @@ void ARMTargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
1136611366
II = BB->rbegin(), IE = BB->rend(); II != IE; ++II) {
1136711367
if (!II->isCall()) continue;
1136811368

11369-
DenseMap<unsigned, bool> DefRegs;
11369+
DenseSet<unsigned> DefRegs;
1137011370
for (MachineInstr::mop_iterator
1137111371
OI = II->operands_begin(), OE = II->operands_end();
1137211372
OI != OE; ++OI) {
1137311373
if (!OI->isReg()) continue;
11374-
DefRegs[OI->getReg()] = true;
11374+
DefRegs.insert(OI->getReg());
1137511375
}
1137611376

1137711377
MachineInstrBuilder MIB(*MF, &*II);
@@ -11386,7 +11386,7 @@ void ARMTargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
1138611386
continue;
1138711387
if (!Subtarget->isThumb() && !ARM::GPRRegClass.contains(Reg))
1138811388
continue;
11389-
if (!DefRegs[Reg])
11389+
if (!DefRegs.contains(Reg))
1139011390
MIB.addReg(Reg, RegState::ImplicitDefine | RegState::Dead);
1139111391
}
1139211392

0 commit comments

Comments
 (0)