Test Failure: Transforms/MergeICmps/X86/pr59740.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. MergeICmpsPass

----------------------------------------
define i1 @full_sequent_ne(ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1) noundef {
%bb0:
  %v0 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s0, align 1
  %v1 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s1, align 1
  %cmp0 = icmp eq i8 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb4

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 1
  %v2 = load i8, ptr %s2, align 1
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 1
  %v3 = load i8, ptr %s3, align 1
  %cmp1 = icmp eq i8 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb4

%bb2:
  %s4 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 2
  %v4 = load i8, ptr %s4, align 1
  %s5 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 2
  %v5 = load i8, ptr %s5, align 1
  %cmp2 = icmp eq i8 %v4, %v5
  br i1 %cmp2, label %bb3, label %bb4

%bb3:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 3
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 3
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb4

%bb4:
  %cmp = phi i1 [ 1, %bb0 ], [ 1, %bb1 ], [ 1, %bb2 ], [ %cmp3, %bb3 ]
  ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)

-- 3. MergeICmpsPass

----------------------------------------
define i1 @full_sequent_ne(ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1) noundef {
%bb0:
  %v0 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s0, align 1
  %v1 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s1, align 1
  %cmp0 = icmp eq i8 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb4

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 1
  %v2 = load i8, ptr %s2, align 1
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 1
  %v3 = load i8, ptr %s3, align 1
  %cmp1 = icmp eq i8 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb4

%bb2:
  %s4 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 2
  %v4 = load i8, ptr %s4, align 1
  %s5 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 2
  %v5 = load i8, ptr %s5, align 1
  %cmp2 = icmp eq i8 %v4, %v5
  br i1 %cmp2, label %bb3, label %bb4

%bb3:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 3
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 3
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb4

%bb4:
  %cmp = phi i1 [ 1, %bb0 ], [ 1, %bb1 ], [ 1, %bb2 ], [ %cmp3, %bb3 ]
  ret i1 %cmp
}
=>
define i1 @full_sequent_ne(ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1) noundef {
%bb0+bb1+bb2+bb3:
  %memcmp = memcmp ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1, i64 4
  %0 = icmp ne i32 %memcmp, 0
  br label %bb4

%bb4:
  ret i1 %0
}
Transformation seems to be correct!

-- 4. PassManager<Function> : Skipping NOP
-- 5. PassManager<Function> : Skipping NOP
-- 6. MergeICmpsPass

----------------------------------------
define i1 @cmp_ne_incorrect_const(ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1) noundef {
%bb0:
  %v0 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s0, align 1
  %v1 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s1, align 1
  %cmp0 = icmp eq i8 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb2

%bb1:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 1
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 1
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb2

%bb2:
  %cmp = phi i1 [ 0, %bb0 ], [ %cmp3, %bb1 ]
  ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)

-- 7. MergeICmpsPass

----------------------------------------
define i1 @cmp_ne_incorrect_const(ptr nocapture nowrite dereferenceable(4) align(1) %s0, ptr nocapture nowrite dereferenceable(4) align(1) %s1) noundef {
%bb0:
  %v0 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s0, align 1
  %v1 = load i8, ptr nocapture nowrite dereferenceable(4) align(1) %s1, align 1
  %cmp0 = icmp eq i8 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb2

%bb1:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s0, 4 x i64 0, 1 x i64 1
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(4) align(1) %s1, 4 x i64 0, 1 x i64 1
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb2

%bb2:
  %cmp = phi i1 [ 0, %bb0 ], [ %cmp3, %bb1 ]
  ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)

-- 8. PassManager<Function> : Skipping NOP
-- 9. PassManager<Function> : Skipping NOP
-- 10. MergeICmpsPass

----------------------------------------
define i1 @partial_sequent_eq(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb0:
  %v0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %v1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %v2 = load i32, ptr %s2, align 8
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %v3 = load i32, ptr %s3, align 8
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 12
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 12
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp eq i8 %v6, %v7
  br label %bb3

%bb3:
  %cmp = phi i1 [ 0, %bb0 ], [ 0, %bb1 ], [ %cmp3, %bb2 ]
  ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)

-- 11. MergeICmpsPass

----------------------------------------
define i1 @partial_sequent_eq(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb0:
  %v0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %v1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %v2 = load i32, ptr %s2, align 8
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %v3 = load i32, ptr %s3, align 8
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 12
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 12
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp eq i8 %v6, %v7
  br label %bb3

%bb3:
  %cmp = phi i1 [ 0, %bb0 ], [ 0, %bb1 ], [ %cmp3, %bb2 ]
  ret i1 %cmp
}
=>
define i1 @partial_sequent_eq(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb01:
  %0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %2 = icmp eq i32 %0, %1
  br i1 %2, label %bb1+bb2, label %bb3

%bb1+bb2:
  %3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %4 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %memcmp = memcmp ptr %3, ptr %4, i64 5
  %5 = icmp eq i32 %memcmp, 0
  br label %bb3

%bb3:
  %cmp = phi i1 [ %5, %bb1+bb2 ], [ 0, %bb01 ]
  ret i1 %cmp
}
Transformation seems to be correct!

-- 12. PassManager<Function> : Skipping NOP
-- 13. PassManager<Function> : Skipping NOP
-- 14. MergeICmpsPass

----------------------------------------
define i1 @partial_sequent_ne(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb0:
  %v0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %v1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %v2 = load i32, ptr %s2, align 8
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %v3 = load i32, ptr %s3, align 8
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 12
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 12
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb3

%bb3:
  %cmp = phi i1 [ 1, %bb0 ], [ 1, %bb1 ], [ %cmp3, %bb2 ]
  ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)

-- 15. MergeICmpsPass

----------------------------------------
define i1 @partial_sequent_ne(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb0:
  %v0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %v1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %v2 = load i32, ptr %s2, align 8
  %s3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %v3 = load i32, ptr %s3, align 8
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s6 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 12
  %v6 = load i8, ptr %s6, align 1
  %s7 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 12
  %v7 = load i8, ptr %s7, align 1
  %cmp3 = icmp ne i8 %v6, %v7
  br label %bb3

%bb3:
  %cmp = phi i1 [ 1, %bb0 ], [ 1, %bb1 ], [ %cmp3, %bb2 ]
  ret i1 %cmp
}
=>
define i1 @partial_sequent_ne(ptr nocapture nowrite dereferenceable(16) %s0, ptr nocapture nowrite dereferenceable(16) %s1) noundef {
%bb01:
  %0 = load i32, ptr nocapture nowrite dereferenceable(16) %s0, align 8
  %1 = load i32, ptr nocapture nowrite dereferenceable(16) %s1, align 8
  %2 = icmp eq i32 %0, %1
  br i1 %2, label %bb1+bb2, label %bb3

%bb1+bb2:
  %3 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s0, 16 x i64 0, 1 x i64 8
  %4 = gep inbounds ptr nocapture nowrite dereferenceable(16) %s1, 16 x i64 0, 1 x i64 8
  %memcmp = memcmp ptr %3, ptr %4, i64 5
  %5 = icmp ne i32 %memcmp, 0
  br label %bb3

%bb3:
  %cmp = phi i1 [ %5, %bb1+bb2 ], [ 1, %bb01 ]
  ret i1 %cmp
}
Transformation seems to be correct!

-- 16. PassManager<Function> : Skipping NOP
-- 17. PassManager<Function> : Skipping NOP
-- 18. MergeICmpsPass

----------------------------------------
define i1 @WebrtcVideoStats(ptr nocapture dereferenceable(16) noundef %S0, ptr nocapture dereferenceable(16) noundef %S1) {
%bb0:
  %V0 = load i8, ptr nocapture dereferenceable(16) noundef %S0, align 4
  %V1 = load i8, ptr nocapture dereferenceable(16) noundef %S1, align 4
  %Cmp0 = icmp eq i8 %V0, %V1
  br i1 %Cmp0, label %bb1, label %bb4

%bb1:
  %Base2 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 4
  %V2 = load i32, ptr %Base2, align 4
  %Base3 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 4
  %V3 = load i32, ptr %Base3, align 4
  %Cmp1 = icmp eq i32 %V2, %V3
  br i1 %Cmp1, label %bb2, label %bb4

%bb2:
  %Base4 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 8
  %V4 = load i8, ptr %Base4, align 4
  %Base5 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 8
  %V5 = load i8, ptr %Base5, align 4
  %Cmp2 = icmp eq i8 %V4, %V5
  br i1 %Cmp2, label %bb3, label %bb4

%bb3:
  %Base6 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 12
  %V6 = load i32, ptr %Base6, align 4
  %Base7 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 12
  %V7 = load i32, ptr %Base7, align 4
  %Cmp3 = icmp ne i32 %V6, %V7
  br label %bb4

%bb4:
  %result = phi i1 [ %Cmp3, %bb3 ], [ 1, %bb2 ], [ 1, %bb1 ], [ 1, %bb0 ]
  ret i1 %result
}
Transformation seems to be correct! (syntactically equal)

-- 19. MergeICmpsPass

----------------------------------------
define i1 @WebrtcVideoStats(ptr nocapture dereferenceable(16) noundef %S0, ptr nocapture dereferenceable(16) noundef %S1) {
%bb0:
  %V0 = load i8, ptr nocapture dereferenceable(16) noundef %S0, align 4
  %V1 = load i8, ptr nocapture dereferenceable(16) noundef %S1, align 4
  %Cmp0 = icmp eq i8 %V0, %V1
  br i1 %Cmp0, label %bb1, label %bb4

%bb1:
  %Base2 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 4
  %V2 = load i32, ptr %Base2, align 4
  %Base3 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 4
  %V3 = load i32, ptr %Base3, align 4
  %Cmp1 = icmp eq i32 %V2, %V3
  br i1 %Cmp1, label %bb2, label %bb4

%bb2:
  %Base4 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 8
  %V4 = load i8, ptr %Base4, align 4
  %Base5 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 8
  %V5 = load i8, ptr %Base5, align 4
  %Cmp2 = icmp eq i8 %V4, %V5
  br i1 %Cmp2, label %bb3, label %bb4

%bb3:
  %Base6 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 12
  %V6 = load i32, ptr %Base6, align 4
  %Base7 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 12
  %V7 = load i32, ptr %Base7, align 4
  %Cmp3 = icmp ne i32 %V6, %V7
  br label %bb4

%bb4:
  %result = phi i1 [ %Cmp3, %bb3 ], [ 1, %bb2 ], [ 1, %bb1 ], [ 1, %bb0 ]
  ret i1 %result
}
=>
define i1 @WebrtcVideoStats(ptr nocapture dereferenceable(16) noundef %S0, ptr nocapture dereferenceable(16) noundef %S1) {
%bb02:
  %0 = load i8, ptr nocapture dereferenceable(16) noundef %S0, align 4
  %1 = load i8, ptr nocapture dereferenceable(16) noundef %S1, align 4
  %2 = icmp eq i8 %0, %1
  br i1 %2, label %bb1+bb2, label %bb4

%bb1+bb2:
  %3 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 4
  %4 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 4
  %memcmp = memcmp ptr %3, ptr %4, i64 5
  %5 = icmp eq i32 %memcmp, 0
  br i1 %5, label %bb31, label %bb4

%bb31:
  %6 = gep inbounds ptr nocapture dereferenceable(16) noundef %S0, 16 x i64 0, 1 x i64 12
  %7 = gep inbounds ptr nocapture dereferenceable(16) noundef %S1, 16 x i64 0, 1 x i64 12
  %8 = load i32, ptr %6, align 4
  %9 = load i32, ptr %7, align 4
  %10 = icmp ne i32 %8, %9
  br label %bb4

%bb4:
  %result = phi i1 [ %10, %bb31 ], [ 1, %bb1+bb2 ], [ 1, %bb02 ]
  ret i1 %result
}
Transformation seems to be correct!

-- 20. PassManager<Function> : Skipping NOP
-- 21. PassManager<Function> : Skipping NOP
-- 22. MergeICmpsPass

----------------------------------------
define i1 @full_revert_order_ne(ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, ptr nonnull nocapture nowrite dereferenceable(24) noundef %1) {
%bb0:
  %s0 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 8
  %v0 = load i32, ptr %s0, align 4
  %s1 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 8
  %v1 = load i32, ptr %s1, align 4
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 4
  %v2 = load i32, ptr %s2, align 4
  %s3 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 4
  %v3 = load i32, ptr %s3, align 4
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s4 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 0
  %v4 = load i32, ptr %s4, align 4
  %s5 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 0
  %v5 = load i32, ptr %s5, align 4
  %cmp2 = icmp ne i32 %v4, %v5
  br label %bb3

%bb3:
  %cmp3 = phi i1 [ 1, %bb1 ], [ 1, %bb0 ], [ %cmp2, %bb2 ]
  ret i1 %cmp3
}
Transformation seems to be correct! (syntactically equal)

-- 23. MergeICmpsPass

----------------------------------------
define i1 @full_revert_order_ne(ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, ptr nonnull nocapture nowrite dereferenceable(24) noundef %1) {
%bb0:
  %s0 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 8
  %v0 = load i32, ptr %s0, align 4
  %s1 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 8
  %v1 = load i32, ptr %s1, align 4
  %cmp0 = icmp eq i32 %v0, %v1
  br i1 %cmp0, label %bb1, label %bb3

%bb1:
  %s2 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 4
  %v2 = load i32, ptr %s2, align 4
  %s3 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 4
  %v3 = load i32, ptr %s3, align 4
  %cmp1 = icmp eq i32 %v2, %v3
  br i1 %cmp1, label %bb2, label %bb3

%bb2:
  %s4 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 0
  %v4 = load i32, ptr %s4, align 4
  %s5 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 0
  %v5 = load i32, ptr %s5, align 4
  %cmp2 = icmp ne i32 %v4, %v5
  br label %bb3

%bb3:
  %cmp3 = phi i1 [ 1, %bb1 ], [ 1, %bb0 ], [ %cmp2, %bb2 ]
  ret i1 %cmp3
}
=>
define i1 @full_revert_order_ne(ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, ptr nonnull nocapture nowrite dereferenceable(24) noundef %1) {
%bb2+bb1+bb0:
  %2 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %0, 16 x i64 0, 1 x i64 0
  %3 = gep inbounds ptr nonnull nocapture nowrite dereferenceable(24) noundef %1, 16 x i64 0, 1 x i64 0
  %memcmp = memcmp ptr %2, ptr %3, i64 12
  %4 = icmp ne i32 %memcmp, 0
  br label %bb3

%bb3:
  ret i1 %4
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
ptr nonnull nocapture nowrite dereferenceable(24) noundef %0 = pointer(non-local, block_id=0, offset=66, attrs=3)
ptr nonnull nocapture nowrite dereferenceable(24) noundef %1 = pointer(non-local, block_id=0, offset=102, attrs=3)

Source:
ptr %s0 = pointer(non-local, block_id=0, offset=74, attrs=3)
i32 %v0 = #x01010000 (16842752)
ptr %s1 = pointer(non-local, block_id=0, offset=110, attrs=3)
i32 %v1 = #x00000000 (0)
i1 %cmp0 = #x0 (0)
  >> Jump to %bb3
i1 %cmp3 = #x1 (1)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 128	align: 8589934592	alloc type: 0	address: 2
Block 1 >	size: 9	align: 2	alloc type: 0	address: 192

Target:
ptr %2 = pointer(non-local, block_id=0, offset=66, attrs=3)
ptr %3 = pointer(non-local, block_id=0, offset=102, attrs=3)
i32 %memcmp = poison
i1 %4 = poison
  >> Jump to %bb3
Source value: #x1 (1)
Target value: poison

Pass: MergeICmpsPass
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-passes=mergeicmps' '-verify-dom-info' '-S' '-mtriple=x86_64-unknown-unknown' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_BMZMI2D3_4EXP.bc"


------------------- SMT STATS -------------------
Num queries: 26
Num invalid: 0
Num skips:   0
Num trivial: 27 (50.9%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     16 (61.5%)
Num UNSAT:   10 (38.5%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -passes=mergeicmps -verify-dom-info -S -mtriple=x86_64-unknown-unknown
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/pr59740.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/pr59740.ll

 

<-- Back