Skip to content

[llvm] Remove extraneous calls to make_range (NFC) #133551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ bool LoadStoreOpt::mergeFunctionStores(MachineFunction &MF) {
// Erase all dead instructions left over by the merging.
if (Changed) {
for (auto &BB : MF) {
for (auto &I : make_early_inc_range(make_range(BB.rbegin(), BB.rend()))) {
for (auto &I : make_early_inc_range(reverse(BB))) {
if (isTriviallyDead(I, *MRI))
I.eraseFromParent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ unsigned getNonFlagSettingVariant(unsigned Opc) {

bool AArch64PostSelectOptimize::doPeepholeOpts(MachineBasicBlock &MBB) {
bool Changed = false;
for (auto &MI : make_early_inc_range(make_range(MBB.begin(), MBB.end()))) {
for (auto &MI : make_early_inc_range(MBB)) {
bool CurrentIterChanged = foldSimpleCrossClassCopies(MI);
if (!CurrentIterChanged)
CurrentIterChanged |= foldCopyDup(MI);
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,8 +1377,7 @@ static Instruction *rematerializeChain(ArrayRef<Instruction *> ChainToBase,
Instruction *LastClonedValue = nullptr;
Instruction *LastValue = nullptr;
// Walk backwards to visit top-most instructions first.
for (Instruction *Instr :
make_range(ChainToBase.rbegin(), ChainToBase.rend())) {
for (Instruction *Instr : reverse(ChainToBase)) {
// Only GEP's and casts are supported as we need to be careful to not
// introduce any new uses of pointers not in the liveset.
// Note that it's fine to introduce new uses of pointers which were
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
// In "RemoveDIs" non-instr debug-info mode, drop DbgVariableRecords attached
// to these instructions, in the same way that dbg.value intrinsics are
// dropped at the end of this block.
for (auto &It : make_range(ThenBB->begin(), ThenBB->end()))
for (auto &It : *ThenBB)
for (DbgRecord &DR : make_early_inc_range(It.getDbgRecordRange()))
// Drop all records except assign-kind DbgVariableRecords (dbg.assign
// equivalent).
Expand Down