[llvm] [UnrollAnalyzerTest] Remove dependency to pass managers (PR #78473)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 03:13:40 PST 2024
================
@@ -6,61 +6,52 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopUnrollAnalyzer.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Dominators.h"
-#include "llvm/IR/LegacyPassManager.h"
-#include "llvm/InitializePasses.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
using namespace llvm;
namespace llvm {
-void initializeUnrollAnalyzerTestPass(PassRegistry &);
static SmallVector<DenseMap<Value *, Value *>, 16> SimplifiedValuesVector;
static unsigned TripCount = 0;
-namespace {
-struct UnrollAnalyzerTest : public FunctionPass {
- static char ID;
- bool runOnFunction(Function &F) override {
- LoopInfo *LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
- ScalarEvolution *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
+/// Build loop info and scalar evolution for the function and run the analysis.
+static void runUnrollAnalyzer(Module &M, StringRef FuncName) {
----------------
fhahn wrote:
while you are at it, could you also add SimplifiedValuesVector as an argument to the function instead of using a static global?
https://github.com/llvm/llvm-project/pull/78473
More information about the llvm-commits
mailing list