Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor ERROR: Unsupported instruction: store volatile i8 4, ptr %g, align 1 ERROR: Unsupported attribute: nofree ERROR: Unsupported attribute: nofree -- 1. PassManager<Function> : Skipping NOP -- 2. InstCombinePass ---------------------------------------- declare ptr @malloc(i32) noalias alloc-family(malloc) allockind(alloc, uninitialized) allocsize(0) declare void @free(ptr) alloc-family(malloc) allockind(free) define i32 @main(i32 %argc, ptr %argv) { #0: %c_19 = alloca i64 4, align 4 %__constexpr_2 = gep ptr null, 1 x i32 1 %__constexpr_1 = ptrtoint ptr %__constexpr_2 to i32 %__constexpr_0 = mul i32 %__constexpr_1, 10 %malloc_206 = tail call ptr @malloc(noundef i32 %__constexpr_0) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized) allocsize(0) memory(inaccessiblemem: readwrite) store ptr %malloc_206, ptr %c_19, align 4 %tmp_207 = load ptr, ptr %c_19, align 4 tail call void @free(noundef allocptr ptr %tmp_207) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite) ret i32 0 } Transformation seems to be correct! (syntactically equal) -- 3. InstCombinePass ---------------------------------------- declare ptr @malloc(i32) noalias alloc-family(malloc) allockind(alloc, uninitialized) allocsize(0) declare void @free(ptr) alloc-family(malloc) allockind(free) define i32 @main(i32 %argc, ptr %argv) { #0: %c_19 = alloca i64 4, align 4 %__constexpr_2 = gep ptr null, 1 x i32 1 %__constexpr_1 = ptrtoint ptr %__constexpr_2 to i32 %__constexpr_0 = mul i32 %__constexpr_1, 10 %malloc_206 = tail call ptr @malloc(noundef i32 %__constexpr_0) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized) allocsize(0) memory(inaccessiblemem: readwrite) store ptr %malloc_206, ptr %c_19, align 4 %tmp_207 = load ptr, ptr %c_19, align 4 tail call void @free(noundef allocptr ptr %tmp_207) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite) ret i32 0 } => define i32 @main(i32 %argc, ptr %argv) { #0: ret i32 0 } Transformation seems to be correct! -- 4. PassManager<Function> : Skipping NOP -- 5. PassManager<Function> : Skipping NOP -- 6. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) declare void @free(ptr) alloc-family(malloc) allockind(free) define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 %alignment, noundef i32 %size) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) store i8 %value, ptr %aligned_allocation, align 1 tail call void @free(noundef allocptr ptr %aligned_allocation) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite) ret i32 0 } Transformation seems to be correct! (syntactically equal) -- 7. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) declare void @free(ptr) alloc-family(malloc) allockind(free) define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 %alignment, noundef i32 %size) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) store i8 %value, ptr %aligned_allocation, align 8 tail call void @free(noundef allocptr ptr %aligned_allocation) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite) ret i32 0 } => define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) { #0: ret i32 0 } Transformation seems to be correct! -- 8. PassManager<Function> : Skipping NOP -- 9. PassManager<Function> : Skipping NOP -- 10. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_only_pointe(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 %alignment, noundef i32 %size) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 11. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_only_pointe(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 %alignment, noundef i32 %size) nofree noundef nothrow noalias willreturn alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 12. PassManager<Function> : Skipping NOP -- 13. PassManager<Function> : Skipping NOP -- 14. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_alignment_and_value_known_ok(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 8, noundef i32 32) nofree noundef nothrow noalias willreturn dereferenceable_or_null(32) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 15. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_alignment_and_value_known_ok(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 8, noundef i32 32) nofree noundef nothrow noalias willreturn dereferenceable_or_null(32) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null, use_provenance ret i1 %cmp } => define i1 @aligned_alloc_pointer_only_used_by_cmp_alignment_and_value_known_ok(i32 %size, i32 %alignment, i8 %value) { #0: ret i1 1 } Transformation seems to be correct! -- 16. PassManager<Function> : Skipping NOP -- 17. PassManager<Function> : Skipping NOP -- 18. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_alignment_no_power_of_2(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 3, noundef i32 32) nofree noundef nothrow noalias willreturn dereferenceable_or_null(32) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 19. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_alignment_no_power_of_2(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 3, noundef i32 32) nofree noundef nothrow noalias willreturn dereferenceable_or_null(32) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 20. PassManager<Function> : Skipping NOP -- 21. PassManager<Function> : Skipping NOP -- 22. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_size_not_multiple_of_alignment(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 8, noundef i32 31) nofree noundef nothrow noalias willreturn dereferenceable_or_null(31) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 23. InstCombinePass ---------------------------------------- declare ptr @aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @aligned_alloc_pointer_only_used_by_cmp_size_not_multiple_of_alignment(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @aligned_alloc(noundef allocalign i32 8, noundef i32 31) nofree noundef nothrow noalias willreturn dereferenceable_or_null(31) alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) memory(inaccessiblemem: readwrite) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 24. PassManager<Function> : Skipping NOP -- 25. PassManager<Function> : Skipping NOP -- 26. InstCombinePass ---------------------------------------- declare ptr @other_aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @other_aligned_allocation_function(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @other_aligned_alloc(i32 %alignment, i32 %size) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } Transformation seems to be correct! (syntactically equal) -- 27. InstCombinePass ---------------------------------------- declare ptr @other_aligned_alloc(i32, i32) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) define i1 @other_aligned_allocation_function(i32 %size, i32 %alignment, i8 %value) { #0: %aligned_allocation = tail call ptr @other_aligned_alloc(i32 %alignment, i32 %size) noalias alloc-family(malloc) allockind(alloc, uninitialized, aligned) allocsize(1) %cmp = icmp ne ptr %aligned_allocation, null ret i1 %cmp } => define i1 @other_aligned_allocation_function(i32 %size, i32 %alignment, i8 %value) { #0: ret i1 1 } Transformation doesn't verify! (unsound) ERROR: Value mismatch Example: i32 %size = #xf91202a0 (4178707104, -116260192) i32 %alignment = poison i8 %value = poison Source: ptr %aligned_allocation = null i1 %cmp = #x0 (0) SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: 0 LOCAL BLOCKS: Block 2 > size: 2031223456 align: 8 alloc type: 2 alive: false Target: Source value: #x0 (0) Target value: #x1 (1) Pass: InstCombinePass 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=instcombine' '-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_EaAGqBtN_uvNe.bc" ------------------- SMT STATS ------------------- Num queries: 22 Num invalid: 0 Num skips: 0 Num trivial: 25 (53.2%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 16 (72.7%) Num UNSAT: 6 (27.3%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free.ll -passes=instcombine -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free.ll