Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor ERROR: Unsupported type: <vscale x 4 x i32> ERROR: Unsupported metadata: 7 ERROR: Unsupported metadata: 30 ERROR: Unsupported metadata: 7 ERROR: Unsupported instruction: %rv = invoke i32 @use_nocapture(ptr %dest) to label %suc unwind labe ERROR: Unsupported instruction: %src = alloca i8, i64 24, align 4, addrspace(1) -- 1. PassManager<Function> : Skipping NOP -- 2. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @basic_memcpy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 3. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @basic_memcpy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @basic_memcpy() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 4. PassManager<Function> : Skipping NOP -- 5. PassManager<Function> : Skipping NOP -- 6. MemCpyOptPass ---------------------------------------- define i32 @use_not_dominated_by_src_alloca() { #0: %dest = alloca i64 1, align 1 %dest.gep = gep ptr %dest, 8 x i64 -1 %dest.use = load i8, ptr %dest.gep, align 1 %src = alloca i64 1, align 4 %src.val = load i1, ptr %src, align 4 store i1 %src.val, ptr %dest, align 1 ret i32 0 } Transformation seems to be correct! (syntactically equal) -- 7. MemCpyOptPass ---------------------------------------- define i32 @use_not_dominated_by_src_alloca() { #0: %dest = alloca i64 1, align 1 %dest.gep = gep ptr %dest, 8 x i64 -1 %dest.use = load i8, ptr %dest.gep, align 1 %src = alloca i64 1, align 4 %src.val = load i1, ptr %src, align 4 store i1 %src.val, ptr %dest, align 1 ret i32 0 } => define i32 @use_not_dominated_by_src_alloca() { #0: %src = alloca i64 1, align 4 %dest.gep = gep ptr %src, 8 x i64 -1 %dest.use = load i8, ptr %dest.gep, align 4 ret i32 0 } **************************************** WARNING: Source function is always UB. It can be refined by any target function. Please make sure this is what you wanted. **************************************** Transformation seems to be correct! -- 8. PassManager<Function> : Skipping NOP -- 9. PassManager<Function> : Skipping NOP -- 10. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @basic_memmove() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memmove ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 11. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @basic_memmove() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memmove ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @basic_memmove() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 12. PassManager<Function> : Skipping NOP -- 13. PassManager<Function> : Skipping NOP -- 14. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @load_store() { #0: %src = alloca i64 4, align 4, dead %dest = alloca i64 4, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store i32 42, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %src.val = load i32, ptr %src, align 4 store i32 %src.val, ptr %dest, align 4 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 15. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @load_store() { #0: %src = alloca i64 4, align 4, dead %dest = alloca i64 4, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store i32 42, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %src.val = load i32, ptr %src, align 4 store i32 %src.val, ptr %dest, align 4 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @load_store() { #0: %src = alloca i64 4, align 4 store i32 42, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 16. PassManager<Function> : Skipping NOP -- 17. PassManager<Function> : Skipping NOP ERROR: Unsupported type: <vscale x 4 x i32> -- 18. MemCpyOptPass ERROR: Unsupported type: <vscale x 4 x i32> -- 19. MemCpyOptPass ERROR: Unsupported type: <vscale x 4 x i32> -- 20. PassManager<Function> : Skipping NOP ERROR: Unsupported type: <vscale x 4 x i32> -- 21. PassManager<Function> : Skipping NOP -- 22. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @align_up() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 8, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 23. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @align_up() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 8, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 8, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @align_up() { #0: %src = alloca i64 12, align 8 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 8 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 24. PassManager<Function> : Skipping NOP -- 25. PassManager<Function> : Skipping NOP -- 26. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @remove_extra_lifetime_intrinsics() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 end_lifetime ptr %src %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src start_lifetime ptr %src fillpoison ptr %src %#3 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src start_lifetime ptr %dest fillpoison ptr %dest end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 27. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @remove_extra_lifetime_intrinsics() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 end_lifetime ptr %src %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src start_lifetime ptr %src fillpoison ptr %src %#3 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src start_lifetime ptr %dest fillpoison ptr %dest end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @remove_extra_lifetime_intrinsics() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) %#3 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 28. PassManager<Function> : Skipping NOP -- 29. PassManager<Function> : Skipping NOP -- 30. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @no_lifetime() { #0: %src = alloca i64 12, align 4 %dest = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) %#3 = call i32 @use_nocapture(nocapture ptr %dest) ret void } Transformation seems to be correct! (syntactically equal) -- 31. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @no_lifetime() { #0: %src = alloca i64 12, align 4 %dest = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) %#3 = call i32 @use_nocapture(nocapture ptr %dest) ret void } => declare i32 @use_nocapture(nocapture ptr) define void @no_lifetime() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) %#3 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 32. PassManager<Function> : Skipping NOP -- 33. PassManager<Function> : Skipping NOP -- 34. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @alias_no_mod() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest %dest.alias = gep ptr %dest, 12 x i32 0, 1 x i64 0 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %src.alias = gep ptr %src, 12 x i32 0, 1 x i64 0 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 35. MemCpyOptPass ---------------------------------------- declare i32 @use_nocapture(nocapture ptr) define void @alias_no_mod() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#2 = call i32 @use_nocapture(nocapture ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_nocapture(nocapture ptr) define void @alias_no_mod() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_nocapture(nocapture ptr %src) %#2 = call i32 @use_nocapture(nocapture ptr %src) ret void } Transformation seems to be correct! -- 36. PassManager<Function> : Skipping NOP -- 37. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 7 -- 38. MemCpyOptPass ERROR: Unsupported metadata: 7 -- 39. MemCpyOptPass ERROR: Unsupported metadata: 7 -- 40. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 7 -- 41. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 30 -- 42. MemCpyOptPass ERROR: Unsupported metadata: 30 -- 43. MemCpyOptPass ERROR: Unsupported metadata: 7 -- 44. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 7 -- 45. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 7 -- 46. MemCpyOptPass ERROR: Unsupported metadata: 7 -- 47. MemCpyOptPass ERROR: Unsupported metadata: 7 -- 48. PassManager<Function> : Skipping NOP ERROR: Unsupported metadata: 7 -- 49. PassManager<Function> : Skipping NOP -- 50. MemCpyOptPass ---------------------------------------- declare i32 @use_readonly(nowrite ptr) define void @src_ref_dest_ref_after_copy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#1 = call i32 @use_readonly(nocapture nowrite ptr %src) %#2 = call i32 @use_readonly(nocapture nowrite ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 51. MemCpyOptPass ---------------------------------------- declare i32 @use_readonly(nowrite ptr) define void @src_ref_dest_ref_after_copy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#1 = call i32 @use_readonly(nocapture nowrite ptr %src) %#2 = call i32 @use_readonly(nocapture nowrite ptr %dest) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_readonly(nowrite ptr) define void @src_ref_dest_ref_after_copy() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_readonly(nocapture nowrite ptr %src) %#2 = call i32 @use_readonly(nocapture nowrite ptr %src) ret void } Transformation seems to be correct! -- 52. PassManager<Function> : Skipping NOP -- 53. PassManager<Function> : Skipping NOP -- 54. MemCpyOptPass ---------------------------------------- declare i32 @use_writeonly(noundef ptr) memory(write) define void @src_mod_dest_mod_after_copy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#1 = call i32 @use_writeonly(nocapture noundef ptr %src) memory(write) %#2 = call i32 @use_writeonly(nocapture noundef ptr %dest) memory(write) end_lifetime ptr %src end_lifetime ptr %dest ret void } Transformation seems to be correct! (syntactically equal) -- 55. MemCpyOptPass ---------------------------------------- declare i32 @use_writeonly(noundef ptr) memory(write) define void @src_mod_dest_mod_after_copy() { #0: %src = alloca i64 12, align 4, dead %dest = alloca i64 12, align 4, dead start_lifetime ptr %src start_lifetime ptr %dest store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 memcpy ptr %dest align 4, ptr %src align 4, i64 12 %#1 = call i32 @use_writeonly(nocapture noundef ptr %src) memory(write) %#2 = call i32 @use_writeonly(nocapture noundef ptr %dest) memory(write) end_lifetime ptr %src end_lifetime ptr %dest ret void } => declare i32 @use_writeonly(noundef ptr) memory(write) define void @src_mod_dest_mod_after_copy() { #0: %src = alloca i64 12, align 4 store {i32, i32, i32} { 10, 20, 30 }, ptr %src, align 4 %#1 = call i32 @use_writeonly(nocapture noundef ptr %src) memory(write) %#2 = call i32 @use_writeonly(nocapture noundef ptr %src) memory(write) ret void } Transformation doesn't verify! (unsound) ERROR: Source and target don't have the same return domain Example: Source: ptr %src = null ptr %dest = pointer(local, block_id=1, offset=0) i32 %#1 = poison i32 %#2 = function did not return! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: 0 Block 1 > size: 16 align: 1 alloc type: 0 alive: true address: 0 LOCAL BLOCKS: Block 2 > size: 12 align: 4 alloc type: 1 alive: false Block 3 > size: 12 align: 4 alloc type: 1 alive: false Target: ptr %src = null i32 %#1 = function did not return! TARGET MEMORY STATE =================== LOCAL BLOCKS: Block 2 > size: 12 align: 4 alloc type: 1 alive: true address: 256 Pass: MemCpyOptPass 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=memcpyopt' '-verify-memoryssa' '-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_eBcU5sD2_MIZt.bc" ------------------- SMT STATS ------------------- Num queries: 34 Num invalid: 0 Num skips: 0 Num trivial: 58 (63.0%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 31 (91.2%) Num UNSAT: 3 (8.8%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/MemCpyOpt/stack-move.ll -passes=memcpyopt -verify-memoryssa -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MemCpyOpt/stack-move.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=memcpyopt -verify-memoryssa -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MemCpyOpt/stack-move.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MemCpyOpt/stack-move.ll