Test Failure: Transforms/IndVarSimplify/post-inc-range.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define void @test(ptr %base, i32 %limit, i32 %start) {
%for.body.lr.ph:
  br label %for.body

%for.body:
  %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
  %within_limits = icmp ult i32 %i, 64
  br i1 %within_limits, label %continue, label %for.end

%continue:
  %i.i64 = zext i32 %i to i64
  %arrayidx = gep inbounds ptr %base, 4 x i64 %i.i64
  %val = load i32, ptr %arrayidx, align 4
  br label %for.inc

%for.inc:
  %i.inc = add nsw nuw i32 %i, 1
  %cmp = icmp slt i32 %i.inc, %limit
  br i1 %cmp, label %for.body, label %for.end

%for.end:
  br label %exit

%exit:
  ret void
}
=>
define void @test(ptr %base, i32 %limit, i32 %start) {
%for.body.lr.ph:
  %umax = umax i32 %start, 64
  %0 = sub i32 %umax, %start
  %1 = add i32 %start, 1
  %smax = smax i32 %limit, %1
  %2 = add i32 %smax, 4294967295
  %3 = sub i32 %2, %start
  %umin = umin i32 %3, %0
  %4 = icmp ne i32 %0, %umin
  %5 = icmp ne i32 %3, %umin
  br label %for.body

%for.body:
  br i1 %4, label %continue, label %for.end

%continue:
  br label %for.inc

%for.inc:
  br i1 %5, label %for.body, label %for.end

%for.end:
  br label %exit

%exit:
  ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
ptr %base = poison
i32 %limit = poison
i32 %start = #x00001002 (4098)

Source:
  >> Jump to %for.body
i32 %i = #x00001002 (4098)
i1 %within_limits = #x0 (0)
  >> Jump to %for.end
  >> Jump to %exit

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

Target:
i32 %umax = #x00001002 (4098)
i32 %0 = #x00000000 (0)
i32 %1 = #x00001003 (4099)
i32 %smax = poison
i32 %2 = poison
i32 %3 = poison
i32 %umin = poison
i1 %4 = poison
i1 %5 = poison
  >> Jump to %for.body
UB triggered on br



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

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
+ /home/nlopes/alive2/build/opt-alive.sh -indvars -indvars-post-increment-ranges -S

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

 

<-- Back