Skip to content

Commit 1380a82

Browse files
[AMDGPU] Use llvm::find and llvm::find_if (NFC) (llvm#135582)
1 parent e710a5a commit 1380a82

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,12 +1491,10 @@ bool MFMAExpInterleaveOpt::analyzeDAG(const SIInstrInfo *TII) {
14911491
return isBitPack(Opc);
14921492
});
14931493

1494-
auto *PackPred =
1495-
std::find_if((*TempMFMA)->Preds.begin(), (*TempMFMA)->Preds.end(),
1496-
[&isBitPack](SDep &Pred) {
1497-
auto Opc = Pred.getSUnit()->getInstr()->getOpcode();
1498-
return isBitPack(Opc);
1499-
});
1494+
auto *PackPred = llvm::find_if((*TempMFMA)->Preds, [&isBitPack](SDep &Pred) {
1495+
auto Opc = Pred.getSUnit()->getInstr()->getOpcode();
1496+
return isBitPack(Opc);
1497+
});
15001498

15011499
if (PackPred == (*TempMFMA)->Preds.end())
15021500
return false;

llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,7 @@ void AMDGPUSwLowerLDS::lowerNonKernelLDSAccesses(
10811081
IRB.CreateLoad(IRB.getPtrTy(AMDGPUAS::GLOBAL_ADDRESS), BaseLoad);
10821082

10831083
for (GlobalVariable *GV : LDSGlobals) {
1084-
const auto *GVIt =
1085-
std::find(OrdereLDSGlobals.begin(), OrdereLDSGlobals.end(), GV);
1084+
const auto *GVIt = llvm::find(OrdereLDSGlobals, GV);
10861085
assert(GVIt != OrdereLDSGlobals.end());
10871086
uint32_t GVOffset = std::distance(OrdereLDSGlobals.begin(), GVIt);
10881087

llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void SIMachineFunctionInfo::shiftWwmVGPRsToLowestRange(
352352

353353
// Replace the register in SpillPhysVGPRs. This is needed to look for free
354354
// lanes while spilling special SGPRs like FP, BP, etc. during PEI.
355-
auto *RegItr = std::find(SpillPhysVGPRs.begin(), SpillPhysVGPRs.end(), Reg);
355+
auto *RegItr = llvm::find(SpillPhysVGPRs, Reg);
356356
if (RegItr != SpillPhysVGPRs.end()) {
357357
unsigned Idx = std::distance(SpillPhysVGPRs.begin(), RegItr);
358358
SpillPhysVGPRs[Idx] = NewReg;

0 commit comments

Comments
 (0)