bool Modified = false;
// Start with ADRP.
- InstrToInstrs *ColorOpToReachedUses = new InstrToInstrs[NbReg];
+ std::vector<InstrToInstrs> COTRUVector(NbReg);
+ auto ColorOpToReachedUses = COTRUVector.data();
// Compute the reaching def in ADRP mode, meaning ADRP definitions
// are first considered as uses.
// Compute LOH for ADRP.
computeADRP(ADRPToReachingDefs, *AArch64FI, MDT);
- delete[] ColorOpToReachedUses;
-
// Continue with general ADRP -> ADD/LDR -> LDR/STR pattern.
- ColorOpToReachedUses = new InstrToInstrs[NbReg];
+ COTRUVector.clear();
+ COTRUVector.resize(NbReg);
// first perform a regular reaching def analysis.
reachingDef(MF, ColorOpToReachedUses, RegToId, false, DummyOp);
// Compute other than AdrpAdrp LOH.
computeOthers(UsesToReachingDefs, ColorOpToReachedUses, *AArch64FI, RegToId,
MDT);
- delete[] ColorOpToReachedUses;
if (BasicBlockScopeOnly)
MF.DeleteMachineInstr(DummyOp);