Test Failure: Transforms/LoopUnswitch/2007-08-01-LCSSA.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
@.str9 = constant 1 bytes, align 1

define i32 @_ZN9Generator6strregEPKc(* %this, * %s) {
%entry:
  %__constexpr_0 = gep inbounds * @.str9, 1 x i32 0, 1 x i32 0
  %s_addr.0 = select i1 0, * %__constexpr_0, * %s
  %tmp122 = icmp eq * %s_addr.0, null
  br label %bb184

%bb184:
  %i33.0 = phi i32 [ 0, %entry ], [ %tmp183, %bb166 ]
  %idx.0 = phi i32 [ 0, %entry ], [ %tmp181, %bb166 ]
  %tmp49 = icmp slt i32 %i33.0, 0
  br i1 %tmp49, label %bb88, label %bb55

%bb88:
  br i1 %tmp122, label %bb154, label %bb128

%bb154:
  br i1 0, label %bb250, label %bb166

%bb128:
  %tmp138 = call i32 @strcmp(* null, * %s_addr.0)	; WARNING: unknown known function
  %iftmp.37.0.in4 = icmp eq i32 %tmp138, 0
  br i1 %iftmp.37.0.in4, label %bb250, label %bb166

%bb250:
  ret i32 %idx.0

%bb166:
  %tmp175 = add i32 %idx.0, 1
  %tmp177 = add i32 %tmp175, 0
  %tmp181 = add i32 %tmp177, 0
  %tmp183 = add i32 %i33.0, 1
  br label %bb184

%bb55:
  ret i32 0
}
=>
@.str9 = constant 1 bytes, align 1

define i32 @_ZN9Generator6strregEPKc(* %this, * %s) {
%entry:
  %tmp122 = icmp eq * %s, null
  br i1 %tmp122, label %entry.split.us, label %entry.entry.split_crit_edge

%entry.entry.split_crit_edge:
  br label %entry.split

%entry.split:
  br label %bb184

%bb184:
  %i33.0 = phi i32 [ 0, %entry.split ], [ %tmp183, %bb166 ]
  %idx.0 = phi i32 [ 0, %entry.split ], [ %tmp175, %bb166 ]
  %tmp49 = icmp slt i32 %i33.0, 0
  br i1 %tmp49, label %bb88, label %bb55.us-lcssa

%bb88:
  br i1 0, label %bb154, label %bb128

%bb154:
  br i1 0, label %bb250.us-lcssa, label %bb166

%bb128:
  %tmp138 = call i32 @strcmp(* null, * %s)	; WARNING: unknown known function
  %iftmp.37.0.in4 = icmp eq i32 %tmp138, 0
  br i1 %iftmp.37.0.in4, label %bb250.us-lcssa, label %bb166

%bb250.us-lcssa:
  br label %bb250

%bb166:
  %tmp175 = add i32 %idx.0, 1
  %tmp183 = add i32 %i33.0, 1
  br label %bb184

%bb55.us-lcssa:
  br label %bb55

%entry.split.us:
  br label %bb184.us

%bb184.us:
  %i33.0.us = phi i32 [ 0, %entry.split.us ], [ %tmp183.us, %bb166.us ]
  %tmp49.us = icmp slt i32 %i33.0.us, 0
  br i1 %tmp49.us, label %bb88.us, label %bb55.us-lcssa.us

%bb88.us:
  br i1 1, label %bb154.us, label %bb128.us

%bb154.us:
  br i1 0, label %bb250.us-lcssa.us, label %bb166.us

%bb128.us:
  br i1 undef, label %bb250.us-lcssa.us, label %bb166.us

%bb250.us-lcssa.us:
  br label %bb250

%bb250:
  %idx.0.lcssa1 = phi i32 [ %idx.0, %bb250.us-lcssa ], [ undef, %bb250.us-lcssa.us ]
  ret i32 %idx.0.lcssa1

%bb166.us:
  %tmp183.us = add i32 %i33.0.us, 1
  br label %bb184.us

%bb55.us-lcssa.us:
  br label %bb55

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

Example:
* %this = poison
* %s = poison

Source:
* %__constexpr_0 = pointer(non-local, block_id=1, offset=0)
* %s_addr.0 = poison
i1 %tmp122 = poison
i32 %i33.0 = #x00000000 (0)
i32 %idx.0 = #x00000000 (0)
i1 %tmp49 = #x0 (0)

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

Target:
i1 %tmp122 = poison
i32 %i33.0 = #x00000000 (0)
i32 %idx.0 = #x00000000 (0)
i1 %tmp49 = #x0 (0)
i32 %i33.0.us = #x00000000 (0)
i1 %tmp49.us = #x0 (0)



------------------- SMT STATS -------------------
Num queries: 2
Num invalid: 0
Num skips:   0
Num trivial: 0 (0.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     2 (100.0%)
Num UNSAT:   0 (0.0%)

stderr:

+ : 'RUN: at line 1'
+ /home/nlopes/alive2/scripts/opt-alive.sh -loop-unswitch -instcombine -disable-output

Alive2: Transform doesn't verify; aborting!

 

<-- Back