[llvm] c508e93 - [InstSimplify] Remove unused ORE argument (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 01:38:40 PDT 2023
Author: Nikita Popov
Date: 2023-04-14T10:38:32+02:00
New Revision: c508e933270d457166c3226b53d8c81619c3e350
URL: https://github.com/llvm/llvm-project/commit/c508e933270d457166c3226b53d8c81619c3e350
DIFF: https://github.com/llvm/llvm-project/commit/c508e933270d457166c3226b53d8c81619c3e350.diff
LOG: [InstSimplify] Remove unused ORE argument (NFC)
Added:
Modified:
llvm/include/llvm/Analysis/InstructionSimplify.h
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/InstructionSimplify.h b/llvm/include/llvm/Analysis/InstructionSimplify.h
index 826bd45d8057b..761ed2eec03f6 100644
--- a/llvm/include/llvm/Analysis/InstructionSimplify.h
+++ b/llvm/include/llvm/Analysis/InstructionSimplify.h
@@ -50,7 +50,6 @@ class Function;
class Instruction;
struct LoopStandardAnalysisResults;
class MDNode;
-class OptimizationRemarkEmitter;
class Pass;
template <class T, unsigned n> class SmallSetVector;
class TargetLibraryInfo;
@@ -325,15 +324,13 @@ Value *simplifyLoadInst(LoadInst *LI, Value *PtrOp, const SimplifyQuery &Q);
/// See if we can compute a simplified version of this instruction. If not,
/// return null.
-Value *simplifyInstruction(Instruction *I, const SimplifyQuery &Q,
- OptimizationRemarkEmitter *ORE = nullptr);
+Value *simplifyInstruction(Instruction *I, const SimplifyQuery &Q);
/// Like \p simplifyInstruction but the operands of \p I are replaced with
/// \p NewOps. Returns a simplified value, or null if none was found.
Value *
simplifyInstructionWithOperands(Instruction *I, ArrayRef<Value *> NewOps,
- const SimplifyQuery &Q,
- OptimizationRemarkEmitter *ORE = nullptr);
+ const SimplifyQuery &Q);
/// See if V simplifies when its operand Op is replaced with RepOp. If not,
/// return null.
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index ce41f8a20c02d..9cb6ba83c77c9 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -6681,8 +6681,7 @@ Value *llvm::simplifyLoadInst(LoadInst *LI, Value *PtrOp,
static Value *simplifyInstructionWithOperands(Instruction *I,
ArrayRef<Value *> NewOps,
- const SimplifyQuery &SQ,
- OptimizationRemarkEmitter *ORE) {
+ const SimplifyQuery &SQ) {
const SimplifyQuery Q = SQ.CxtI ? SQ : SQ.getWithInstruction(I);
switch (I->getOpcode()) {
@@ -6797,17 +6796,15 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
Value *llvm::simplifyInstructionWithOperands(Instruction *I,
ArrayRef<Value *> NewOps,
- const SimplifyQuery &SQ,
- OptimizationRemarkEmitter *ORE) {
+ const SimplifyQuery &SQ) {
assert(NewOps.size() == I->getNumOperands() &&
"Number of operands should match the instruction!");
- return ::simplifyInstructionWithOperands(I, NewOps, SQ, ORE);
+ return ::simplifyInstructionWithOperands(I, NewOps, SQ);
}
-Value *llvm::simplifyInstruction(Instruction *I, const SimplifyQuery &SQ,
- OptimizationRemarkEmitter *ORE) {
+Value *llvm::simplifyInstruction(Instruction *I, const SimplifyQuery &SQ) {
SmallVector<Value *, 8> Ops(I->operands());
- Value *Result = ::simplifyInstructionWithOperands(I, Ops, SQ, ORE);
+ Value *Result = ::simplifyInstructionWithOperands(I, Ops, SQ);
/// If called on unreachable code, the instruction may simplify to itself.
/// Make life easier for users by detecting that case here, and returning a
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 3a092997301b7..ffa4bd859034b 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -11201,11 +11201,10 @@ struct AAPotentialValuesFloating : AAPotentialValuesImpl {
InfoCache.getAnalysisResultForFunction<DominatorTreeAnalysis>(*F);
const auto *TLI = A.getInfoCache().getTargetLibraryInfoForFunction(*F);
auto *AC = InfoCache.getAnalysisResultForFunction<AssumptionAnalysis>(*F);
- OptimizationRemarkEmitter *ORE = nullptr;
const DataLayout &DL = I.getModule()->getDataLayout();
SimplifyQuery Q(DL, TLI, DT, AC, &I);
- Value *NewV = simplifyInstructionWithOperands(&I, NewOps, Q, ORE);
+ Value *NewV = simplifyInstructionWithOperands(&I, NewOps, Q);
if (!NewV || NewV == &I)
return false;
diff --git a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
index 4644905adba3d..ee9452ce1c7d4 100644
--- a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
+++ b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
@@ -11,7 +11,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/InstructionSimplify.h"
-#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
@@ -26,8 +25,7 @@ using namespace llvm;
STATISTIC(NumSimplified, "Number of redundant instructions removed");
-static bool runImpl(Function &F, const SimplifyQuery &SQ,
- OptimizationRemarkEmitter *ORE) {
+static bool runImpl(Function &F, const SimplifyQuery &SQ) {
SmallPtrSet<const Instruction *, 8> S1, S2, *ToSimplify = &S1, *Next = &S2;
bool Changed = false;
@@ -51,7 +49,7 @@ static bool runImpl(Function &F, const SimplifyQuery &SQ,
DeadInstsInBB.push_back(&I);
Changed = true;
} else if (!I.use_empty()) {
- if (Value *V = simplifyInstruction(&I, SQ, ORE)) {
+ if (Value *V = simplifyInstruction(&I, SQ)) {
// Mark all uses for resimplification next time round the loop.
for (User *U : I.users())
Next->insert(cast<Instruction>(U));
@@ -88,7 +86,6 @@ struct InstSimplifyLegacyPass : public FunctionPass {
AU.addRequired<DominatorTreeWrapperPass>();
AU.addRequired<AssumptionCacheTracker>();
AU.addRequired<TargetLibraryInfoWrapperPass>();
- AU.addRequired<OptimizationRemarkEmitterWrapperPass>();
}
/// Remove instructions that simplify.
@@ -102,11 +99,9 @@ struct InstSimplifyLegacyPass : public FunctionPass {
&getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
AssumptionCache *AC =
&getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
- OptimizationRemarkEmitter *ORE =
- &getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();
const DataLayout &DL = F.getParent()->getDataLayout();
const SimplifyQuery SQ(DL, TLI, DT, AC);
- return runImpl(F, SQ, ORE);
+ return runImpl(F, SQ);
}
};
} // namespace
@@ -117,7 +112,6 @@ INITIALIZE_PASS_BEGIN(InstSimplifyLegacyPass, "instsimplify",
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass)
INITIALIZE_PASS_END(InstSimplifyLegacyPass, "instsimplify",
"Remove redundant instructions", false, false)
@@ -131,10 +125,9 @@ PreservedAnalyses InstSimplifyPass::run(Function &F,
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
auto &AC = AM.getResult<AssumptionAnalysis>(F);
- auto &ORE = AM.getResult<OptimizationRemarkEmitterAnalysis>(F);
const DataLayout &DL = F.getParent()->getDataLayout();
const SimplifyQuery SQ(DL, &TLI, &DT, &AC);
- bool Changed = runImpl(F, SQ, &ORE);
+ bool Changed = runImpl(F, SQ);
if (!Changed)
return PreservedAnalyses::all();
More information about the llvm-commits
mailing list