[polly] r276551 - GPGPU: Optimize kernel IR before generating assembly code
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 23 23:43:21 PDT 2016
Author: grosser
Date: Sun Jul 24 01:43:21 2016
New Revision: 276551
URL: http://llvm.org/viewvc/llvm-project?rev=276551&view=rev
Log:
GPGPU: Optimize kernel IR before generating assembly code
We optimize the kernel _after_ dumping the IR we generate to make the IR we
dump easier readable and independent of possible changes in the general
purpose LLVM optimizers.
Modified:
polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
Modified: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp?rev=276551&r1=276550&r2=276551&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp Sun Jul 24 01:43:21 2016
@@ -32,6 +32,7 @@
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "isl/union_map.h"
@@ -683,6 +684,14 @@ void GPUNodeBuilder::finalizeKernelFunct
if (DumpKernelIR)
outs() << *GPUModule << "\n";
+ // Optimize module.
+ llvm::legacy::PassManager OptPasses;
+ PassManagerBuilder PassBuilder;
+ PassBuilder.OptLevel = 3;
+ PassBuilder.SizeLevel = 0;
+ PassBuilder.populateModulePassManager(OptPasses);
+ OptPasses.run(*GPUModule);
+
std::string Assembly = createKernelASM();
if (DumpKernelASM)
More information about the llvm-commits
mailing list