Test Failure: Transforms/SimplifyCFG/sink-cb-diff-attrs.ll

Test source: git

Log:

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

----------------------------------------
declare ptr @foo0()
declare void @side.effect()

define ptr @test_sink_no_args_oneside(i1 %c) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo0() nofree memory(read)
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo0()
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 3. SimplifyCFGPass

----------------------------------------
declare ptr @foo0()
declare void @side.effect()

define ptr @test_sink_no_args_oneside(i1 %c) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo0() nofree memory(read)
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo0()
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo0()

define ptr @test_sink_no_args_oneside(i1 %c) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %r2 = call ptr @foo0()
  ret ptr %r2
}
Transformation seems to be correct!

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

----------------------------------------
declare ptr @foo0()
declare void @side.effect()

define ptr @test_sink_no_args_oneside_fail(i1 %c) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo0() nofree memory(read)
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo0()
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 7. SimplifyCFGPass

----------------------------------------
declare ptr @foo0()
declare void @side.effect()

define ptr @test_sink_no_args_oneside_fail(i1 %c) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo0() nofree memory(read)
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo0()
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

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

----------------------------------------
declare ptr @foo2(ptr, ptr, i64)
declare void @side.effect()

define ptr @test_sink_int_attrs(i1 %c, ptr %p, ptr %p2, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %#range_0_%x = !range i64 %x, i64 10000, i64 100000
  %r2 = call ptr @foo2(align(32) dereferenceable_or_null(200) ptr %p, dereferenceable(100) align(32) ptr %p2, i64 %#range_0_%x) memory(write)
  br label %end

if:
  call void @side.effect()
  %#range_1_%x = !range i64 %x, i64 10, i64 1000
  %r = call ptr @foo2(align(64) dereferenceable_or_null(100) ptr %p, dereferenceable(50) align(64) ptr %p2, i64 %#range_1_%x) nofree memory(read)
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 11. SimplifyCFGPass

----------------------------------------
declare ptr @foo2(ptr, ptr, i64)
declare void @side.effect()

define ptr @test_sink_int_attrs(i1 %c, ptr %p, ptr %p2, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %#range_0_%x = !range i64 %x, i64 10000, i64 100000
  %r2 = call ptr @foo2(align(32) dereferenceable_or_null(200) ptr %p, dereferenceable(100) align(32) ptr %p2, i64 %#range_0_%x) memory(write)
  br label %end

if:
  call void @side.effect()
  %#range_1_%x = !range i64 %x, i64 10, i64 1000
  %r = call ptr @foo2(align(64) dereferenceable_or_null(100) ptr %p, dereferenceable(50) align(64) ptr %p2, i64 %#range_1_%x) nofree memory(read)
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo2(ptr, ptr, i64)

define ptr @test_sink_int_attrs(i1 %c, ptr %p, ptr %p2, i64 %x) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %#range_0_%x = !range i64 %x, i64 10, i64 100000
  %r2 = call ptr @foo2(align(32) dereferenceable_or_null(100) ptr %p, dereferenceable(50) align(32) ptr %p2, i64 %#range_0_%x)
  ret ptr %r2
}
Transformation seems to be correct!

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

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_int_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %#range_0_%x = !range i64 %x, i64 11, i64 100
  %r2 = call ptr @foo(dereferenceable(100) align(32) dereferenceable_or_null(200) ptr %p, i64 %#range_0_%x) nofree memory(none)
  br label %end

if:
  call void @side.effect()
  %#range_1_%x = !range i64 %x, i64 10, i64 1000
  %r = call ptr @foo(dereferenceable(50) ptr %p, i64 %#range_1_%x) nofree memory(read)
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 15. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_int_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %#range_0_%x = !range i64 %x, i64 11, i64 100
  %r2 = call ptr @foo(dereferenceable(100) align(32) dereferenceable_or_null(200) ptr %p, i64 %#range_0_%x) nofree memory(none)
  br label %end

if:
  call void @side.effect()
  %#range_1_%x = !range i64 %x, i64 10, i64 1000
  %r = call ptr @foo(dereferenceable(50) ptr %p, i64 %#range_1_%x) nofree memory(read)
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo(ptr, i64)

define ptr @test_sink_int_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %#range_0_%x = !range i64 %x, i64 10, i64 1000
  %r2 = call ptr @foo(dereferenceable(50) ptr %p, i64 %#range_0_%x) nofree memory(read)
  ret ptr %r2
}
Transformation seems to be correct!

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

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull nowrite ptr %p, noundef i64 %x) nonnull nofree noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nonnull noread nowrite noundef ptr %p, noundef i64 %x) nofree noundef willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 19. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull nowrite ptr %p, noundef i64 %x) nonnull nofree noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nonnull noread nowrite noundef ptr %p, noundef i64 %x) nofree noundef willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo(ptr, i64)

define ptr @test_sink_bool_attrs2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %r2 = call ptr @foo(nonnull ptr %p, noundef i64 %x) nofree noundef willreturn
  ret ptr %r2
}
Transformation seems to be correct!

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

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs3(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull noread ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 23. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs3(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull noread ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo(ptr, i64)

define ptr @test_sink_bool_attrs3(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %r2 = call ptr @foo(ptr %p, noundef i64 %x) nonnull willreturn
  ret ptr %r2
}
Transformation seems to be correct!

-- 24. PassManager<Function> : Skipping NOP
-- 25. PassManager<Function> : Skipping NOP
-- 26. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull noread ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 27. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull noread ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 28. PassManager<Function> : Skipping NOP
-- 29. PassManager<Function> : Skipping NOP
-- 30. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 31. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable2(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef willreturn
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(nowrite noundef ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 32. PassManager<Function> : Skipping NOP
-- 33. PassManager<Function> : Skipping NOP
-- 34. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable3(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(byval(4) nowrite noundef align(4) ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 35. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs_fail_non_droppable3(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(byval(4) nowrite noundef align(4) ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 36. PassManager<Function> : Skipping NOP
-- 37. PassManager<Function> : Skipping NOP
-- 38. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs4(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(byval(8) nowrite noundef align(4) ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
Transformation seems to be correct! (syntactically equal)

-- 39. SimplifyCFGPass

----------------------------------------
declare ptr @foo(ptr, i64)
declare void @side.effect()

define ptr @test_sink_bool_attrs4(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %else

else:
  %r2 = call ptr @foo(nonnull byval(8) noread align(4) ptr %p, noundef i64 %x) nonnull noundef
  br label %end

if:
  call void @side.effect()
  %r = call ptr @foo(byval(8) nowrite noundef align(4) ptr %p, noundef i64 %x) nonnull nofree willreturn
  br label %end

end:
  %pr = phi ptr [ %r, %if ], [ %r2, %else ]
  ret ptr %pr
}
=>
declare void @side.effect()
declare ptr @foo(ptr, i64)

define ptr @test_sink_bool_attrs4(i1 %c, ptr %p, i64 %x) {
#0:
  br i1 %c, label %if, label %end

if:
  call void @side.effect()
  br label %end

end:
  %r2 = call ptr @foo(byval(8) align(4) ptr %p, noundef i64 %x) nonnull
  ret ptr %r2
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
i1 %c = #x1 (1)
ptr %p = pointer(non-local, block_id=1, offset=0) / Address=#x4
i64 %x = #x0000000000000000 (0)

Source:
  >> Jump to %if
Function @side.effect returned
ptr %r = poison
  >> Jump to %end
ptr %pr = poison

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 8	align: 4	alloc type: 0	alive: true	address: 4
Block 2 >	size: 0	align: 4	alloc type: 0	alive: true	address: 12
Block 3 >	size: 0	align: 1	alloc type: 0	alive: true	address: 1

Target:
  >> Jump to %if
Function @side.effect returned
  >> Jump to %end
Function @foo triggered UB


Pass: SimplifyCFGPass
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=simplifycfg<sink-common-insts>' '-simplifycfg-require-and-preserve-domtree=1' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_mWOzhqO4_IixK.bc"


------------------- SMT STATS -------------------
Num queries: 68
Num invalid: 0
Num skips:   0
Num trivial: 10 (12.8%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     36 (52.9%)
Num UNSAT:   32 (47.1%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/sink-cb-diff-attrs.ll -passes='simplifycfg<sink-common-insts>' -simplifycfg-require-and-preserve-domtree=1 -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/sink-cb-diff-attrs.ll
+ /home/nlopes/alive2/build/opt-alive.sh '-passes=simplifycfg<sink-common-insts>' -simplifycfg-require-and-preserve-domtree=1 -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/sink-cb-diff-attrs.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/sink-cb-diff-attrs.ll

 

<-- Back