summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-05-17 16:02:43 +0200
committerFrancisco Jerez <[email protected]>2016-07-11 20:22:21 -0700
commit5884dfbc2a39adbbcc8ef7e7b53d4299ba2616ff (patch)
treecad2d9b5551784968c69c38c78f16e0d944622f0 /src/gallium/state_trackers/clover
parentbdc27f13d53759ce9c1c7f58e62a259a18b2ca33 (diff)
clover/llvm: Trivial codestyle clean-up for optimize().
Reviewed-by: Serge Martin <[email protected]> Tested-by: Jan Vesely <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-rw-r--r--src/gallium/state_trackers/clover/llvm/invocation.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index e9b3db695f8..2ca57d04300 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -278,10 +278,10 @@ namespace {
}
void
- optimize(llvm::Module *mod, unsigned optimization_level) {
- compat::pass_manager PM;
+ optimize(Module &mod, unsigned optimization_level) {
+ compat::pass_manager pm;
- compat::add_data_layout_pass(PM);
+ compat::add_data_layout_pass(pm);
// By default, the function internalizer pass will look for a function
// called "main" and then mark all other functions as internal. Marking
@@ -295,15 +295,15 @@ namespace {
// list of kernel functions to the internalizer. The internalizer will
// treat the functions in the list as "main" functions and internalize
// all of the other functions.
- compat::add_internalize_pass(PM, map(std::mem_fn(&Function::getName),
- find_kernels(mod)));
-
- llvm::PassManagerBuilder PMB;
- PMB.OptLevel = optimization_level;
- PMB.LibraryInfo = new compat::target_library_info(
- llvm::Triple(mod->getTargetTriple()));
- PMB.populateModulePassManager(PM);
- PM.run(*mod);
+ compat::add_internalize_pass(pm, map(std::mem_fn(&Function::getName),
+ find_kernels(&mod)));
+
+ ::llvm::PassManagerBuilder pmb;
+ pmb.OptLevel = optimization_level;
+ pmb.LibraryInfo = new compat::target_library_info(
+ ::llvm::Triple(mod.getTargetTriple()));
+ pmb.populateModulePassManager(pm);
+ pm.run(mod);
}
// Kernel metadata
@@ -790,7 +790,7 @@ clover::compile_program_llvm(const std::string &source,
r_log);
auto mod = compile(*ctx, *c, "input.cl", source, headers, target, opts, r_log);
- optimize(&*mod, c->getCodeGenOpts().OptimizationLevel);
+ optimize(*mod, c->getCodeGenOpts().OptimizationLevel);
if (get_debug_flags() & DBG_LLVM) {
std::string log;