Test Failure: Transforms/IndVarSimplify/loop-predication.ll

Test source: git

Log:

Source: <stdin>
ERROR: Unsupported instruction:   store volatile i32 0, i32* %a, align 4

----------------------------------------
define i32 @test1(* %array, i32 %length, i32 %n) {
%loop.preheader:
  br label %loop

%loop:
  %loop.acc = phi i32 [ 0, %loop.preheader ], [ %loop.acc.next, %guarded ]
  %i = phi i32 [ 0, %loop.preheader ], [ %i.next, %guarded ]
  %within.bounds = icmp ult i32 %i, %length
  br i1 %within.bounds, label %guarded, label %deopt

%guarded:
  %i.i64 = zext i32 %i to i64
  %array.i.ptr = gep inbounds * %array, 4 x i64 %i.i64
  %array.i = load i32, * %array.i.ptr, align 4
  %loop.acc.next = add i32 %loop.acc, %array.i
  %i.next = add nuw i32 %i, 1
  %continue = icmp ult i32 %i.next, %n
  br i1 %continue, label %loop, label %exit

%exit:
  %result = phi i32 [ %loop.acc.next, %guarded ]
  ret i32 %result

%deopt:
  call void @prevent_merging()
  ret i32 4294967295
}
=>
define i32 @test1(* %array, i32 %length, i32 %n) {
%loop.preheader:
  %umax = umax i32 %n, 1
  %0 = add i32 %umax, 4294967295
  %umin = umin i32 %length, %0
  %1 = icmp ne i32 %length, %umin
  br label %loop

%loop:
  %loop.acc = phi i32 [ 0, %loop.preheader ], [ %loop.acc.next, %guarded ]
  %i = phi i32 [ 0, %loop.preheader ], [ %i.next, %guarded ]
  br i1 %1, label %guarded, label %deopt

%guarded:
  %i.i64 = zext i32 %i to i64
  %array.i.ptr = gep inbounds * %array, 4 x i64 %i.i64
  %array.i = load i32, * %array.i.ptr, align 4
  %loop.acc.next = add i32 %loop.acc, %array.i
  %i.next = add nuw i32 %i, 1
  %continue = icmp ult i32 %i.next, %n
  br i1 %continue, label %loop, label %exit

%exit:
  %result = phi i32 [ %loop.acc.next, %guarded ]
  ret i32 %result

%deopt:
  call void @prevent_merging()
  ret i32 4294967295
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
* %array = poison
i32 %length = #x00000000 (0)
i32 %n = poison

Source:
i32 %loop.acc = #x00000000 (0)
i32 %i = #x00000000 (0)
i1 %within.bounds = #x0 (0)
i64 %i.i64 = #x0000000000000000 (0)
* %array.i.ptr = poison
i32 %array.i = poison
i32 %loop.acc.next = poison
i32 %i.next = #x00000001 (1)
i1 %continue = poison
i32 %result = poison

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0
Block 1 >	align: 32	alloc type: 0
Block 2 >	align: 2	alloc type: 0

Target:
i32 %umax = poison
i32 %0 = poison
i32 %umin = poison
i1 %1 = poison
i32 %loop.acc = #x00000000 (0)
i32 %i = #x00000000 (0)
i64 %i.i64 = #x0000000000000000 (0)
* %array.i.ptr = poison
i32 %array.i = poison
i32 %loop.acc.next = poison
i32 %i.next = #x00000001 (1)
i1 %continue = #x1 (1)
i32 %result = poison



------------------- SMT STATS -------------------
Num queries: 9
Num invalid: 0
Num skips:   0
Num trivial: 11 (55.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     9 (100.0%)
Num UNSAT:   0 (0.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -indvars -indvars-predicate-loops=1 -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/IndVarSimplify/loop-predication.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/IndVarSimplify/loop-predication.ll

 

<-- Back