@@ -1265,7 +1265,7 @@ bool AArch64LoadStoreOpt::findMatchingStore(
12651265 BaseReg == AArch64InstrInfo::getLdStBaseOp (MI).getReg () &&
12661266 AArch64InstrInfo::getLdStOffsetOp (MI).isImm () &&
12671267 isLdOffsetInRangeOfSt (LoadMI, MI, TII) &&
1268- ModifiedRegUnits.available (getLdStRegOp (MI).getReg ())) {
1268+ ! ModifiedRegUnits.contains (getLdStRegOp (MI).getReg ())) {
12691269 StoreI = MBBI;
12701270 return true ;
12711271 }
@@ -1278,7 +1278,7 @@ bool AArch64LoadStoreOpt::findMatchingStore(
12781278
12791279 // Otherwise, if the base register is modified, we have no match, so
12801280 // return early.
1281- if (! ModifiedRegUnits.available (BaseReg))
1281+ if (ModifiedRegUnits.contains (BaseReg))
12821282 return false ;
12831283
12841284 // If we encounter a store aliased with the load, return early.
@@ -1510,7 +1510,7 @@ static std::optional<MCPhysReg> tryToFindRegisterToRename(
15101510
15111511 auto *RegClass = TRI->getMinimalPhysRegClass (Reg);
15121512 for (const MCPhysReg &PR : *RegClass) {
1513- if (DefinedInBB.available (PR) && UsedInBetween.available (PR) &&
1513+ if (! DefinedInBB.contains (PR) && ! UsedInBetween.contains (PR) &&
15141514 !RegInfo.isReserved (PR) && !AnySubOrSuperRegCalleePreserved (PR) &&
15151515 CanBeUsedForAllClasses (PR)) {
15161516 DefinedInBB.addReg (PR);
@@ -1615,9 +1615,9 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I,
16151615 // can't be paired: bail and keep looking.
16161616 if (IsPreLdSt) {
16171617 bool IsOutOfBounds = MIOffset != TII->getMemScale (MI);
1618- bool IsBaseRegUsed = ! UsedRegUnits.available (
1618+ bool IsBaseRegUsed = UsedRegUnits.contains (
16191619 AArch64InstrInfo::getLdStBaseOp (MI).getReg ());
1620- bool IsBaseRegModified = ! ModifiedRegUnits.available (
1620+ bool IsBaseRegModified = ModifiedRegUnits.contains (
16211621 AArch64InstrInfo::getLdStBaseOp (MI).getReg ());
16221622 // If the stored value and the address of the second instruction is
16231623 // the same, it needs to be using the updated register and therefore
@@ -1694,16 +1694,16 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I,
16941694 // ldr x2 [x3]
16951695 // ldr x4 [x2, #8],
16961696 // the first and third ldr cannot be converted to ldp x1, x4, [x2]
1697- if (! ModifiedRegUnits.available (BaseReg))
1697+ if (ModifiedRegUnits.contains (BaseReg))
16981698 return E;
16991699
17001700 // If the Rt of the second instruction was not modified or used between
17011701 // the two instructions and none of the instructions between the second
17021702 // and first alias with the second, we can combine the second into the
17031703 // first.
1704- if (ModifiedRegUnits.available (getLdStRegOp (MI).getReg ()) &&
1704+ if (! ModifiedRegUnits.contains (getLdStRegOp (MI).getReg ()) &&
17051705 !(MI.mayLoad () &&
1706- ! UsedRegUnits.available (getLdStRegOp (MI).getReg ())) &&
1706+ UsedRegUnits.contains (getLdStRegOp (MI).getReg ())) &&
17071707 !mayAlias (MI, MemInsns, AA)) {
17081708
17091709 Flags.setMergeForward (false );
@@ -1716,10 +1716,10 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I,
17161716 // first and the second alias with the first, we can combine the first
17171717 // into the second.
17181718 if (!(MayLoad &&
1719- ! UsedRegUnits.available (getLdStRegOp (FirstMI).getReg ())) &&
1719+ UsedRegUnits.contains (getLdStRegOp (FirstMI).getReg ())) &&
17201720 !mayAlias (FirstMI, MemInsns, AA)) {
17211721
1722- if (ModifiedRegUnits.available (getLdStRegOp (FirstMI).getReg ())) {
1722+ if (! ModifiedRegUnits.contains (getLdStRegOp (FirstMI).getReg ())) {
17231723 Flags.setMergeForward (true );
17241724 Flags.clearRenameReg ();
17251725 return MBBI;
@@ -1761,7 +1761,7 @@ AArch64LoadStoreOpt::findMatchingInsn(MachineBasicBlock::iterator I,
17611761
17621762 // Otherwise, if the base register is modified, we have no match, so
17631763 // return early.
1764- if (! ModifiedRegUnits.available (BaseReg))
1764+ if (ModifiedRegUnits.contains (BaseReg))
17651765 return E;
17661766
17671767 // Update list of instructions that read/write memory.
@@ -1987,8 +1987,8 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnForward(
19871987 // return early.
19881988 // If we are optimizing SP, do not allow instructions that may load or store
19891989 // in between the load and the optimized value update.
1990- if (! ModifiedRegUnits.available (BaseReg) ||
1991- ! UsedRegUnits.available (BaseReg) ||
1990+ if (ModifiedRegUnits.contains (BaseReg) ||
1991+ UsedRegUnits.contains (BaseReg) ||
19921992 (BaseRegSP && MBBI->mayLoadOrStore ()))
19931993 return E;
19941994 }
@@ -2062,8 +2062,8 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
20622062
20632063 // Otherwise, if the base register is used or modified, we have no match, so
20642064 // return early.
2065- if (! ModifiedRegUnits.available (BaseReg) ||
2066- ! UsedRegUnits.available (BaseReg))
2065+ if (ModifiedRegUnits.contains (BaseReg) ||
2066+ UsedRegUnits.contains (BaseReg))
20672067 return E;
20682068 // Keep track if we have a memory access before an SP pre-increment, in this
20692069 // case we need to validate later that the update amount respects the red
0 commit comments