summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-07-24 06:43:17 +0000
committerTobias Grosser <tobias@grosser.es>2016-07-24 06:43:17 +0000
commite1a98343a1f8b00b2df9572baa9151ac80e77a29 (patch)
tree8371bbd6d276c1f33ea3b647445b9d278b1f9bab /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parent1a06fe5f7ea47112a5e8ac6e0cc471ef96759591 (diff)
downloadbcm5719-llvm-e1a98343a1f8b00b2df9572baa9151ac80e77a29.tar.gz
bcm5719-llvm-e1a98343a1f8b00b2df9572baa9151ac80e77a29.zip
GPGPU: Verify kernel IR before generating assembly
llvm-svn: 276550
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 74dd31d91fc..420b3eec356 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -28,6 +28,7 @@
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetMachine.h"
@@ -674,6 +675,10 @@ std::string GPUNodeBuilder::createKernelASM() {
}
void GPUNodeBuilder::finalizeKernelFunction() {
+ // Verify module.
+ llvm::legacy::PassManager Passes;
+ Passes.add(createVerifierPass());
+ Passes.run(*GPUModule);
if (DumpKernelIR)
outs() << *GPUModule << "\n";
OpenPOWER on IntegriCloud