Skip to content

Commit f915015

Browse files
[llvm] Remove extraneous calls to make_range (NFC) (#133551)
1 parent d3c10a3 commit f915015

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ bool LoadStoreOpt::mergeFunctionStores(MachineFunction &MF) {
929929
// Erase all dead instructions left over by the merging.
930930
if (Changed) {
931931
for (auto &BB : MF) {
932-
for (auto &I : make_early_inc_range(make_range(BB.rbegin(), BB.rend()))) {
932+
for (auto &I : make_early_inc_range(reverse(BB))) {
933933
if (isTriviallyDead(I, *MRI))
934934
I.eraseFromParent();
935935
}

llvm/lib/Target/AArch64/GISel/AArch64PostSelectOptimize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ unsigned getNonFlagSettingVariant(unsigned Opc) {
105105

106106
bool AArch64PostSelectOptimize::doPeepholeOpts(MachineBasicBlock &MBB) {
107107
bool Changed = false;
108-
for (auto &MI : make_early_inc_range(make_range(MBB.begin(), MBB.end()))) {
108+
for (auto &MI : make_early_inc_range(MBB)) {
109109
bool CurrentIterChanged = foldSimpleCrossClassCopies(MI);
110110
if (!CurrentIterChanged)
111111
CurrentIterChanged |= foldCopyDup(MI);

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,8 +1377,7 @@ static Instruction *rematerializeChain(ArrayRef<Instruction *> ChainToBase,
13771377
Instruction *LastClonedValue = nullptr;
13781378
Instruction *LastValue = nullptr;
13791379
// Walk backwards to visit top-most instructions first.
1380-
for (Instruction *Instr :
1381-
make_range(ChainToBase.rbegin(), ChainToBase.rend())) {
1380+
for (Instruction *Instr : reverse(ChainToBase)) {
13821381
// Only GEP's and casts are supported as we need to be careful to not
13831382
// introduce any new uses of pointers not in the liveset.
13841383
// Note that it's fine to introduce new uses of pointers which were

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3391,7 +3391,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
33913391
// In "RemoveDIs" non-instr debug-info mode, drop DbgVariableRecords attached
33923392
// to these instructions, in the same way that dbg.value intrinsics are
33933393
// dropped at the end of this block.
3394-
for (auto &It : make_range(ThenBB->begin(), ThenBB->end()))
3394+
for (auto &It : *ThenBB)
33953395
for (DbgRecord &DR : make_early_inc_range(It.getDbgRecordRange()))
33963396
// Drop all records except assign-kind DbgVariableRecords (dbg.assign
33973397
// equivalent).

0 commit comments

Comments
 (0)