swr/rast: Removed superfluous JitManager argument from passes
authorAlok Hota <alok.hota@intel.com>
Fri, 25 May 2018 15:19:47 +0000 (10:19 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Fri, 25 May 2018 15:56:49 +0000 (10:56 -0500)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
src/gallium/drivers/swr/rasterizer/jitter/functionpasses/lower_x86.cpp
src/gallium/drivers/swr/rasterizer/jitter/functionpasses/passes.h
src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.cpp
src/gallium/drivers/swr/swr_shader.cpp

index 72bf900c85e04f74a71d8315e7cde56318a6b037..20f2e42eec91215bfb71779d71fa2147fcac8a99 100644 (file)
@@ -819,7 +819,7 @@ struct BlendJit : public Builder
         passes.add(createSCCPPass());
         passes.add(createAggressiveDCEPass());
 
-        passes.add(createLowerX86Pass(JM(), this));
+        passes.add(createLowerX86Pass(this));
 
         passes.run(*blendFunc);
 
index 7b0b80a7139ba7495717ee0557c5bc4c03f0031b..0abcd1a8d765d47dfc9c6d6656cf35460fc26542 100644 (file)
@@ -269,7 +269,7 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
 
     optPasses.run(*fetch);
 
-    optPasses.add(createLowerX86Pass(JM(), this));
+    optPasses.add(createLowerX86Pass(this));
     optPasses.run(*fetch);
 
     JitManager::DumpToFile(fetch, "opt");
index 5a69eaef26054ea349773deffdb574f1f711d6d8..f2bd8889fc50b9fb0be1b3d2cded47dbd9005739 100644 (file)
@@ -136,21 +136,21 @@ namespace SwrJit
 
     struct LowerX86 : public FunctionPass
     {
-        LowerX86(JitManager* pJitMgr = nullptr, Builder* b = nullptr)
-            : FunctionPass(ID), mpJitMgr(pJitMgr), B(b)
+        LowerX86(Builder* b = nullptr)
+            : FunctionPass(ID), B(b)
         {
             initializeLowerX86Pass(*PassRegistry::getPassRegistry());
 
             // Determine target arch
-            if (mpJitMgr->mArch.AVX512F())
+            if (JM()->mArch.AVX512F())
             {
                 mTarget = AVX512;
             }
-            else if (mpJitMgr->mArch.AVX2())
+            else if (JM()->mArch.AVX2())
             {
                 mTarget = AVX2;
             }
-            else if (mpJitMgr->mArch.AVX())
+            else if (JM()->mArch.AVX())
             {
                 mTarget = AVX;
 
@@ -356,9 +356,8 @@ namespace SwrJit
         {
         }
 
-        JitManager* JM() { return mpJitMgr; }
+        JitManager* JM() { return B->JM(); }
 
-        JitManager* mpJitMgr;
         Builder* B;
 
         TargetArch mTarget;
@@ -368,9 +367,9 @@ namespace SwrJit
 
     char LowerX86::ID = 0;   // LLVM uses address of ID as the actual ID.
 
-    FunctionPass* createLowerX86Pass(JitManager* pJitMgr, Builder* b)
+    FunctionPass* createLowerX86Pass(Builder* b)
     {
-        return new LowerX86(pJitMgr, b);
+        return new LowerX86(b);
     }
 
     Instruction* NO_EMU(LowerX86* pThis, TargetArch arch, TargetWidth width, CallInst* pCallInst)
index f7373f034bee9a440f6c39098cd9de846a89c9c8..95ef4bcf01671a5c0f061030590c5bc62cd7ac9e 100644 (file)
@@ -33,5 +33,5 @@ namespace SwrJit
 {
     using namespace llvm;
 
-    FunctionPass* createLowerX86Pass(JitManager* pJitMgr, Builder* b);
+    FunctionPass* createLowerX86Pass(Builder* b);
 }
index f804900291e46da6ff17a3981128692ac5ea0834..cb2e3aed61a8be71dec129bff2b29f4f8a2e1719 100644 (file)
@@ -307,7 +307,7 @@ struct StreamOutJit : public Builder
         passes.add(createSCCPPass());
         passes.add(createAggressiveDCEPass());
 
-        passes.add(createLowerX86Pass(JM(), this));
+        passes.add(createLowerX86Pass(this));
 
         passes.run(*soFunc);
 
index 13d89863fd7b65122704f33846bc8bf22efeb2ee..afa184fc4664ab3d7373c56306595e72279d4e24 100644 (file)
@@ -1402,7 +1402,7 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
 
    // after the gallivm passes, we have to lower the core's intrinsics
    llvm::legacy::FunctionPassManager lowerPass(JM()->mpCurrentModule);
-   lowerPass.add(createLowerX86Pass(mpJitMgr, this));
+   lowerPass.add(createLowerX86Pass(this));
    lowerPass.run(*pFunction);
 
    PFN_PIXEL_KERNEL kernel =