-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Analysis] Use llvm::append_range (NFC) #133602
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
[Analysis] Use llvm::append_range (NFC) #133602
Conversation
|
@llvm/pr-subscribers-llvm-analysis Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/133602.diff 4 Files Affected:
diff --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
index ca011362702ac..a6af7304b1c7e 100644
--- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
+++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp
@@ -78,8 +78,7 @@ void IRInstructionData::initializeInstruction() {
// We capture the incoming BasicBlocks as values as well as the incoming
// Values in order to check for structural similarity.
if (PHINode *PN = dyn_cast<PHINode>(Inst))
- for (BasicBlock *BB : PN->blocks())
- OperVals.push_back(BB);
+ llvm::append_range(OperVals, PN->blocks());
}
IRInstructionData::IRInstructionData(IRInstructionDataList &IDList)
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index 45b5b2979a562..94c347b01bbfb 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -1296,11 +1296,8 @@ InductionDescriptor::InductionDescriptor(Value *Start, InductionKind K,
InductionBinOp->getOpcode() == Instruction::FSub))) &&
"Binary opcode should be specified for FP induction");
- if (Casts) {
- for (auto &Inst : *Casts) {
- RedundantCasts.push_back(Inst);
- }
- }
+ if (Casts)
+ llvm::append_range(RedundantCasts, *Casts);
}
ConstantInt *InductionDescriptor::getConstIntStepValue() const {
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 57a76bc7a81e5..7f1b5dc3890a9 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -913,8 +913,7 @@ static void visitPointers(Value *StartPtr, const Loop &InnermostLoop,
// value.
if (PN && InnermostLoop.contains(PN->getParent()) &&
PN->getParent() != InnermostLoop.getHeader()) {
- for (const Use &Inc : PN->incoming_values())
- WorkList.push_back(Inc);
+ llvm::append_range(WorkList, PN->incoming_values());
} else
AddPointer(Ptr);
}
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 600a061d4435e..361206719287a 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -4221,8 +4221,7 @@ bool ScalarEvolution::canReuseInstruction(
if (I->hasPoisonGeneratingAnnotations())
DropPoisonGeneratingInsts.push_back(I);
- for (Value *Op : I->operands())
- Worklist.push_back(Op);
+ llvm::append_range(Worklist, I->operands());
}
return true;
}
@@ -7622,8 +7621,7 @@ ScalarEvolution::getOperandsToCreate(Value *V, SmallVectorImpl<Value *> &Ops) {
case Instruction::GetElementPtr:
assert(cast<GEPOperator>(U)->getSourceElementType()->isSized() &&
"GEP source element type must be sized");
- for (Value *Index : U->operands())
- Ops.push_back(Index);
+ llvm::append_range(Ops, U->operands());
return nullptr;
case Instruction::IntToPtr:
@@ -7656,8 +7654,7 @@ ScalarEvolution::getOperandsToCreate(Value *V, SmallVectorImpl<Value *> &Ops) {
if (CanSimplifyToUnknown())
return getUnknown(U);
- for (Value *Inc : U->operands())
- Ops.push_back(Inc);
+ llvm::append_range(Ops, U->operands());
return nullptr;
break;
}
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/81/builds/5789 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/17/builds/6867 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/41/builds/5829 Here is the relevant piece of the build log for the reference |
No description provided.