[llvm] c86c1e9 - [IndVarSimplify] Uniformly use emplace_back for DeadInsts, nfc
Chen Zheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 14 23:48:20 PDT 2020
Author: Chen Zheng
Date: 2020-07-15T02:48:09-04:00
New Revision: c86c1e972da07ac3417c98e04382a295d4284755
URL: https://github.com/llvm/llvm-project/commit/c86c1e972da07ac3417c98e04382a295d4284755
DIFF: https://github.com/llvm/llvm-project/commit/c86c1e972da07ac3417c98e04382a295d4284755.diff
LOG: [IndVarSimplify] Uniformly use emplace_back for DeadInsts, nfc
Added:
Modified:
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index f6a0b6ea4637..0f36c3f772e6 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2219,7 +2219,7 @@ linearFunctionTestReplace(Loop *L, BasicBlock *ExitingBB,
// update the branch to use the new comparison; in the common case this
// will make old comparison dead.
BI->setCondition(Cond);
- DeadInsts.push_back(OrigCond);
+ DeadInsts.emplace_back(OrigCond);
++NumLFTR;
return true;
@@ -2411,7 +2411,7 @@ bool IndVarSimplify::optimizeLoopExits(Loop *L, SCEVExpander &Rewriter) {
IsTaken ? ExitIfTrue : !ExitIfTrue);
BI->setCondition(NewCond);
if (OldCond->use_empty())
- DeadInsts.push_back(OldCond);
+ DeadInsts.emplace_back(OldCond);
};
bool Changed = false;
@@ -2637,7 +2637,7 @@ bool IndVarSimplify::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
Value *OldCond = BI->getCondition();
BI->setCondition(NewCond);
if (OldCond->use_empty())
- DeadInsts.push_back(OldCond);
+ DeadInsts.emplace_back(OldCond);
Changed = true;
}
More information about the llvm-commits
mailing list