[polly] r287625 - [test] Ensure important basic blocks in test case have side effects

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 23:06:59 PST 2016


Author: grosser
Date: Tue Nov 22 01:06:59 2016
New Revision: 287625

URL: http://llvm.org/viewvc/llvm-project?rev=287625&view=rev
Log:
[test] Ensure important basic blocks in test case have side effects

Add two store instructions at the end of basic blocks that are required to
reproduce the original bug to ensure we always process and model these basic
blocks. This makes this test case stable even in case we would decide to bail
out early of basic blocks which do not modify the global state. Also add
additional check lines to verify how we model the basic block.

Modified:
    polly/trunk/test/Isl/CodeGen/invariant_verify_function_failed_2.ll

Modified: polly/trunk/test/Isl/CodeGen/invariant_verify_function_failed_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/invariant_verify_function_failed_2.ll?rev=287625&r1=287624&r2=287625&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/invariant_verify_function_failed_2.ll (original)
+++ polly/trunk/test/Isl/CodeGen/invariant_verify_function_failed_2.ll Tue Nov 22 01:06:59 2016
@@ -1,10 +1,40 @@
+; RUN: opt %loadPolly -S -polly-scops -analyze \
+; RUN:   -polly-invariant-load-hoisting=true %s \
+; RUN: | FileCheck %s -check-prefix=SCOPS
 ; RUN: opt %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true %s | FileCheck %s
 ;
 ; Check we generate valid code.
-;
+
+; SCOPS:         Statements {
+; SCOPS-NEXT:     	Stmt_if_then2457
+; SCOPS-NEXT:             Domain :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_then2457[] : p_0 = 1 };
+; SCOPS-NEXT:             Schedule :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_then2457[] -> [1] };
+; SCOPS-NEXT:             ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_then2457[] -> MemRef_tmp[] };
+; SCOPS-NEXT:             MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_then2457[] -> MemRef_sub2464[] };
+; SCOPS-NEXT:     	Stmt_cond_false2468
+; SCOPS-NEXT:             Domain :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_cond_false2468[] : p_0 = 1 };
+; SCOPS-NEXT:             Schedule :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_cond_false2468[] -> [2] };
+; SCOPS-NEXT:             ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
+; SCOPS-NEXT:                 [p_0] -> { Stmt_cond_false2468[] -> MemRef_sub2464[] };
+; SCOPS-NEXT:             MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
+; SCOPS-NEXT:                 [p_0] -> { Stmt_cond_false2468[] -> MemRef_A[0] };
+; SCOPS-NEXT:     	Stmt_if_else2493
+; SCOPS-NEXT:             Domain :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_else2493[] : p_0 >= 2 or p_0 = 0 };
+; SCOPS-NEXT:             Schedule :=
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_else2493[] -> [0] : p_0 >= 2 or p_0 = 0 };
+; SCOPS-NEXT:             MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
+; SCOPS-NEXT:                 [p_0] -> { Stmt_if_else2493[] -> MemRef_B[0] };
+; SCOPS-NEXT:     }
+
 ; CHECK: polly.start
-;
-; ModuleID = 'preload_bug.ll'
+
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
@@ -13,7 +43,7 @@ target triple = "x86_64-unknown-linux-gn
 @enc_picture = external global %struct.s*, align 8
 
 ; Function Attrs: nounwind uwtable
-define void @compute_colocated(%struct.s*** %listX) #0 {
+define void @compute_colocated(%struct.s*** %listX, i1* %A, i32* %B) #0 {
 entry:
   br label %for.body2414
 
@@ -39,6 +69,7 @@ if.then2457:
 
 cond.false2468:                                   ; preds = %if.then2457
   %cmp2477 = icmp sgt i32 %sub2464, 127
+  store i1 %cmp2477, i1* %A
   br label %for.inc2621
 
 if.else2493:                                      ; preds = %if.else2454
@@ -48,6 +79,7 @@ if.else2493:
   %tmp5 = load %struct.s*, %struct.s** %arrayidx2498, align 8, !tbaa !1
   %poc2499 = getelementptr inbounds %struct.s, %struct.s* %tmp5, i64 0, i32 1
   %tmp6 = load i32, i32* %poc2499, align 4, !tbaa !5
+  store i32 %tmp6, i32* %B
   br label %for.inc2621
 
 for.inc2621:                                      ; preds = %if.else2493, %cond.false2468




More information about the llvm-commits mailing list