summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer/jitter
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-04-04 17:34:54 -0500
committerGeorge Kyriazis <[email protected]>2018-04-18 10:51:38 -0500
commitc57b5943171a8069764e66a5178b89dca01f3a0e (patch)
tree5f435b4167386dedd996047779e12e42f5e95f00 /src/gallium/drivers/swr/rasterizer/jitter
parent4f0df5e2f7023cff6ce81fe26f40ac3dbf2bbc45 (diff)
swr/rast: Add support for setting optimization level
for JIT compilation Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/jitter')
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp10
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.h1
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.cpp4
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h3
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp1
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h4
6 files changed, 11 insertions, 12 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 90809647b35..7f9c9dd9d7b 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -66,6 +66,7 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
InitializeNativeTargetAsmPrinter();
InitializeNativeTargetDisassembler();
+
TargetOptions tOpts;
tOpts.AllowFPOpFusion = FPOpFusion::Fast;
tOpts.NoInfsFPMath = false;
@@ -74,9 +75,6 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
//tOpts.PrintMachineCode = true;
- mCore = std::string(core);
- std::transform(mCore.begin(), mCore.end(), mCore.begin(), ::tolower);
-
std::unique_ptr<Module> newModule(new Module("", mContext));
mpCurrentModule = newModule.get();
@@ -93,6 +91,12 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
auto optLevel = CodeGenOpt::Aggressive;
+ if (KNOB_JIT_OPTIMIZATION_LEVEL >= CodeGenOpt::None &&
+ KNOB_JIT_OPTIMIZATION_LEVEL <= CodeGenOpt::Aggressive)
+ {
+ optLevel = CodeGenOpt::Level(KNOB_JIT_OPTIMIZATION_LEVEL);
+ }
+
mpExec = EngineBuilder(std::move(newModule))
.setTargetOptions(tOpts)
.setOptLevel(optLevel)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
index 86e6758ada7..c15e0d1b43b 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
@@ -147,7 +147,6 @@ struct JitManager
llvm::FunctionType* mFetchShaderTy;
JitInstructionSet mArch;
- std::string mCore;
// Debugging support
std::unordered_map<llvm::StructType*, llvm::DIType*> mDebugStructMap;
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.cpp
index 38ac8253e59..44fe776d340 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.cpp
@@ -42,6 +42,7 @@ namespace SwrJit
{
mpfnTranslateGfxAddress = nullptr;
mpParamSimDC = nullptr;
+
}
void BuilderGfxMem::NotifyPrivateContextSet()
@@ -133,9 +134,8 @@ namespace SwrJit
return Builder::LOAD(BasePtr, offset, name);
}
- Value* BuilderGfxMem::TranlsateGfxAddress(Value* xpGfxAddress)
+ Value* BuilderGfxMem::TranslateGfxAddress(Value* xpGfxAddress)
{
return INT_TO_PTR(xpGfxAddress, PointerType::get(mInt8Ty, 0));
}
-
}
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
index a1c5f46c700..ab53583c61c 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
@@ -51,7 +51,8 @@ namespace SwrJit
virtual Value *GATHERDD(Value* src, Value* pBase, Value* indices, Value* mask, uint8_t scale = 1, JIT_MEM_CLIENT usage = MEM_CLIENT_INTERNAL);
- Value* TranlsateGfxAddress(Value* xpGfxAddress);
+ Value* TranslateGfxAddress(Value* xpGfxAddress);
+
protected:
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
index a67cb9bec3f..4be5f29061e 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
@@ -694,5 +694,4 @@ namespace SwrJit
// Move builder to beginning of post loop
IRB()->SetInsertPoint(pPostLoop, pPostLoop->begin());
}
-
}
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
index 59b45c1b418..5ca96e7d86c 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
@@ -90,7 +90,3 @@ void Shuffle16bpcGather4(const SWR_FORMAT_INFO &info, Value* vGatherInput[], Val
// Static stack allocations for scatter operations
Value* pScatterStackSrc{ nullptr };
Value* pScatterStackOffsets{ nullptr };
-
-
-
-//virtual Value* TRANSLATE_ADDRESS(Value* address) { return address; }