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(nocapture dereferenceable(1) noundef * null, nocapture dereferenceable(1) noundef * %s_addr.0) nowrite argmemonly nofree noundef nothrow willreturn
  %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(nonnull nocapture dereferenceable(1) noundef * null, nonnull nocapture dereferenceable(1) noundef * %s) nowrite argmemonly nofree noundef nothrow willreturn
  %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: 1	alloc type: 0	address: 0
Block 1 >	size: 1	align: 1	alloc type: 0	address: 2
Block 2 >	size: 7	align: 2	alloc type: 0	address: 8
Block 3 >	size: 3	align: 2	alloc type: 0	address: 4
Block 4 >	size: 3	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: 3
Num invalid: 0
Num skips:   0
Num trivial: 9 (75.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     3 (100.0%)
Num UNSAT:   0 (0.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 1'
+ /home/nlopes/alive2/build/opt-alive.sh -loop-unswitch -enable-new-pm=0 -instcombine -disable-output

 

<-- Back