File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2174,12 +2174,13 @@ bool SILoadStoreOptimizer::promoteConstantOffsetToImm(
2174
2174
2175
2175
// Step1: Find the base-registers and a 64bit constant offset.
2176
2176
MachineOperand &Base = *TII->getNamedOperand (MI, AMDGPU::OpName::vaddr);
2177
+ auto [It, Inserted] = Visited.try_emplace (&MI);
2177
2178
MemAddress MAddr;
2178
- if (!Visited. contains (&MI) ) {
2179
+ if (Inserted ) {
2179
2180
processBaseWithConstOffset (Base, MAddr);
2180
- Visited[&MI] = MAddr;
2181
+ It-> second = MAddr;
2181
2182
} else
2182
- MAddr = Visited[&MI] ;
2183
+ MAddr = It-> second ;
2183
2184
2184
2185
if (MAddr.Offset == 0 ) {
2185
2186
LLVM_DEBUG (dbgs () << " Failed to extract constant-offset or there are no"
@@ -2239,11 +2240,12 @@ bool SILoadStoreOptimizer::promoteConstantOffsetToImm(
2239
2240
const MachineOperand &BaseNext =
2240
2241
*TII->getNamedOperand (MINext, AMDGPU::OpName::vaddr);
2241
2242
MemAddress MAddrNext;
2242
- if (!Visited.contains (&MINext)) {
2243
+ auto [It, Inserted] = Visited.try_emplace (&MINext);
2244
+ if (Inserted) {
2243
2245
processBaseWithConstOffset (BaseNext, MAddrNext);
2244
- Visited[&MINext] = MAddrNext;
2246
+ It-> second = MAddrNext;
2245
2247
} else
2246
- MAddrNext = Visited[&MINext] ;
2248
+ MAddrNext = It-> second ;
2247
2249
2248
2250
if (MAddrNext.Base .LoReg != MAddr.Base .LoReg ||
2249
2251
MAddrNext.Base .HiReg != MAddr.Base .HiReg ||
You can’t perform that action at this time.
0 commit comments