Test Failure: Transforms/SimpleLoopUnswitch/LIV-loop-condtion.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @test(i1 %cond1, i32 %var1) {
%entry:
  br label %loop_begin

%loop_begin:
  %var3 = phi i32 [ %var1, %entry ], [ %var2, %do_something ]
  %cond2 = icmp eq i32 %var3, 10
  %cond.and = and i1 %cond1, %cond2
  br i1 %cond.and, label %do_something, label %loop_exit

%do_something:
  %var2 = add i32 %var3, 1
  call void @some_func() noreturn
  br label %loop_begin

%loop_exit:
  ret i32 0
}
=>
define i32 @test(i1 %cond1, i32 %var1) {
%entry:
  br i1 %cond1, label %entry.split, label %loop_exit.split

%entry.split:
  br label %loop_begin

%loop_begin:
  %var3 = phi i32 [ %var1, %entry.split ], [ %var2, %do_something ]
  %cond2 = icmp eq i32 %var3, 10
  %cond.and = and i1 1, %cond2
  br i1 %cond.and, label %do_something, label %loop_exit

%do_something:
  %var2 = add i32 %var3, 1
  call void @some_func() noreturn
  br label %loop_begin

%loop_exit:
  br label %loop_exit.split

%loop_exit.split:
  ret i32 0
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %cond1 = undef
i32 %var1 = #xfffffff5 (4294967285, -11)

Source:
  >> Jump to %loop_begin
i32 %var3 = #xfffffff5 (4294967285, -11)
i1 %cond2 = #x0 (0)
i1 %cond.and = #x0 (0)
  >> Jump to %loop_exit

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

Target:
UB triggered on br



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

stderr:

+ : 'RUN: at line 1'
+ /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/LIV-loop-condtion.ll
+ /home/nuno/alive2/build/opt-alive.sh -simple-loop-unswitch -verify-memoryssa -S
/home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/LIV-loop-condtion.ll:7:16: error: CHECK-LABEL: expected string not found in input
; CHECK-LABEL: define i32 @test(
               ^
<stdin>:1:1: note: scanning from here

^

Input file: <stdin>
Check file: /home/nuno/llvm/llvm/test/Transforms/SimpleLoopUnswitch/LIV-loop-condtion.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
         1:  
label:7     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
>>>>>>

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back