summaryrefslogtreecommitdiffstats
path: root/polly/test/Isl/CodeGen/RuntimeDebugBuilder
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2018-04-25 19:43:49 +0000
committerMichael Kruse <llvm@meinersbur.de>2018-04-25 19:43:49 +0000
commite819fffee3b948c7699ce3948b35624bf6cc63ae (patch)
tree79845af0f5f0e535085dac7244a7010bfa29813a /polly/test/Isl/CodeGen/RuntimeDebugBuilder
parent152060275fd43196bc34648d1a264e6478555860 (diff)
downloadbcm5719-llvm-e819fffee3b948c7699ce3948b35624bf6cc63ae.tar.gz
bcm5719-llvm-e819fffee3b948c7699ce3948b35624bf6cc63ae.zip
[CodeGen] Print executed statement instances at runtime.
Add the options -polly-codegen-trace-stmts and -polly-codegen-trace-scalars. When enabled, adds a call to the beginning of every generated statement that prints the executed statement instance. With -polly-codegen-trace-scalars, it also prints the value of all scalars that are used in the statement, and PHIs defined in the beginning of the statement. Differential Revision: https://reviews.llvm.org/D45743 llvm-svn: 330864
Diffstat (limited to 'polly/test/Isl/CodeGen/RuntimeDebugBuilder')
-rw-r--r--polly/test/Isl/CodeGen/RuntimeDebugBuilder/stmt_tracing.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/polly/test/Isl/CodeGen/RuntimeDebugBuilder/stmt_tracing.ll b/polly/test/Isl/CodeGen/RuntimeDebugBuilder/stmt_tracing.ll
new file mode 100644
index 00000000000..456b33a0b7e
--- /dev/null
+++ b/polly/test/Isl/CodeGen/RuntimeDebugBuilder/stmt_tracing.ll
@@ -0,0 +1,38 @@
+; RUN: opt %loadPolly -polly-codegen-trace-stmts -polly-codegen-trace-scalars -polly-codegen -S < %s | FileCheck %s
+;
+
+define void @func(i32 %n, double* %A) {
+entry:
+ br label %for
+
+for:
+ %j = phi i32 [0, %entry], [%j.inc, %inc]
+ %j.cmp = icmp slt i32 %j, %n
+ br i1 %j.cmp, label %body, label %exit
+
+ body:
+ %A_idx = getelementptr inbounds double, double* %A, i32 %j
+ store double 0.0, double* %A_idx
+ br label %inc
+
+inc:
+ %j.inc = add nuw nsw i32 %j, 1
+ br label %for
+
+exit:
+ br label %return
+
+return:
+ ret void
+}
+
+
+; CHECK: @0 = private unnamed_addr addrspace(4) constant [10 x i8] c"Stmt_body\00"
+; CHECK: @1 = private unnamed_addr addrspace(4) constant [2 x i8] c"(\00"
+; CHECK: @2 = private unnamed_addr addrspace(4) constant [2 x i8] c")\00"
+; CHECK: @3 = private unnamed_addr addrspace(4) constant [2 x i8] c"\0A\00"
+; CHECK: @4 = private unnamed_addr constant [12 x i8] c"%s%s%ld%s%s\00"
+
+; CHECK: polly.stmt.body:
+; CHECK: call i32 (...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @4, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([10 x i8], [10 x i8] addrspace(4)* @0, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @1, i32 0, i32 0), i64 %polly.indvar, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @2, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @3, i32 0, i32 0))
+; CHECK-NEXT: call i32 @fflush(i8* null)
OpenPOWER on IntegriCloud