[llvm] [UnrollAnalyzerTest] Remove dependency to pass managers (PR #78473)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 04:41: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) {
----------------
bjope wrote:

@fhahn: Certainly! I was a bit annoyed over those as well (having to understand if the subtests could run in parallel etc).

I've added a fixup commit that should be squashed to fix this.

https://github.com/llvm/llvm-project/pull/78473


More information about the llvm-commits mailing list