Test source: git
Comments: LLVM bug: introduces load type punning
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor ERROR: Unsupported metadata: 6 -- 1. PassManager<Function> : Skipping NOP -- 2. GVNPass ---------------------------------------- define i32 @test1(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 0, i32 2 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 3. GVNPass ---------------------------------------- define i32 @test1(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 0, i32 2 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test1(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 4. PassManager<Function> : Skipping NOP -- 5. PassManager<Function> : Skipping NOP -- 6. GVNPass ---------------------------------------- define i32 @test2(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %c = add i32 %a_range, %b ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 7. GVNPass ---------------------------------------- define i32 @test2(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %c = add i32 %a_range, %b ret i32 %c } => define i32 @test2(ptr %p) { #0: %a = load i32, ptr %p, align 4 %c = add i32 %a, %a ret i32 %c } Transformation seems to be correct! -- 8. PassManager<Function> : Skipping NOP -- 9. PassManager<Function> : Skipping NOP -- 10. GVNPass ---------------------------------------- define i32 @test3(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 11. GVNPass ---------------------------------------- define i32 @test3(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test3(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2, i32 3, i32 5 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 12. PassManager<Function> : Skipping NOP -- 13. PassManager<Function> : Skipping NOP -- 14. GVNPass ---------------------------------------- define i32 @test4(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 2, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 15. GVNPass ---------------------------------------- define i32 @test4(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 2, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test4(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 5 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 16. PassManager<Function> : Skipping NOP -- 17. PassManager<Function> : Skipping NOP -- 18. GVNPass ---------------------------------------- define i32 @test5(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 4294967291, i32 4294967294 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 1, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 19. GVNPass ---------------------------------------- define i32 @test5(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 4294967291, i32 4294967294 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 1, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test5(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 4294967291, i32 4294967294, i32 1, i32 5 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 20. PassManager<Function> : Skipping NOP -- 21. PassManager<Function> : Skipping NOP -- 22. GVNPass ---------------------------------------- define i32 @test6(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 10, i32 1 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 12, i32 16 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 23. GVNPass ---------------------------------------- define i32 @test6(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 10, i32 1 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 12, i32 16 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test6(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 10, i32 1 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 24. PassManager<Function> : Skipping NOP -- 25. PassManager<Function> : Skipping NOP -- 26. GVNPass ---------------------------------------- define i32 @test7(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 1, i32 2, i32 3, i32 4 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 5, i32 1 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 27. GVNPass ---------------------------------------- define i32 @test7(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 1, i32 2, i32 3, i32 4 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 5, i32 1 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test7(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 3, i32 4, i32 5, i32 2 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 28. PassManager<Function> : Skipping NOP -- 29. PassManager<Function> : Skipping NOP -- 30. GVNPass ---------------------------------------- define i32 @test8(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 1, i32 5 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 5, i32 1 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 31. GVNPass ---------------------------------------- define i32 @test8(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 1, i32 5 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 5, i32 1 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @test8(ptr %p) { #0: %a = load i32, ptr %p, align 4 %c = add i32 %a, %a ret i32 %c } Transformation seems to be correct! -- 32. PassManager<Function> : Skipping NOP -- 33. PassManager<Function> : Skipping NOP -- 34. GVNPass ---------------------------------------- define i32 @load_noundef_load(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 assume_welldefined i32 %a_range %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 35. GVNPass ---------------------------------------- define i32 @load_noundef_load(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 assume_welldefined i32 %a_range %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @load_noundef_load(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 assume_welldefined i32 %a_range %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 36. PassManager<Function> : Skipping NOP -- 37. PassManager<Function> : Skipping NOP -- 38. GVNPass ---------------------------------------- define i32 @load_load_noundef(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 assume_welldefined i32 %b_range %c = add i32 %a_range, %b_range ret i32 %c } Transformation seems to be correct! (syntactically equal) -- 39. GVNPass ---------------------------------------- define i32 @load_load_noundef(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2 %b = load i32, ptr %p, align 4 %b_range = !range i32 %b, i32 3, i32 5 assume_welldefined i32 %b_range %c = add i32 %a_range, %b_range ret i32 %c } => define i32 @load_load_noundef(ptr %p) { #0: %a = load i32, ptr %p, align 4 %a_range = !range i32 %a, i32 0, i32 2, i32 3, i32 5 %c = add i32 %a_range, %a_range ret i32 %c } Transformation seems to be correct! -- 40. PassManager<Function> : Skipping NOP -- 41. PassManager<Function> : Skipping NOP -- 42. GVNPass ---------------------------------------- declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 assume_dereferenceable ptr %a, i64 10 %b = load ptr, ptr %p, align 8 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %b) nofree memory(none) ret void } Transformation seems to be correct! (syntactically equal) -- 43. GVNPass ---------------------------------------- declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 assume_dereferenceable ptr %a, i64 10 %b = load ptr, ptr %p, align 8 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %b) nofree memory(none) ret void } => declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 assume_dereferenceable ptr %a, i64 10 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %a) nofree memory(none) ret void } Transformation seems to be correct! -- 44. PassManager<Function> : Skipping NOP -- 45. PassManager<Function> : Skipping NOP -- 46. GVNPass ---------------------------------------- declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_not_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 %b = load ptr, ptr %p, align 8 assume_dereferenceable ptr %b, i64 10 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %b) nofree memory(none) ret void } Transformation seems to be correct! (syntactically equal) -- 47. GVNPass ---------------------------------------- declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_not_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 %b = load ptr, ptr %p, align 8 assume_dereferenceable ptr %b, i64 10 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %b) nofree memory(none) ret void } => declare void @use.ptr(ptr) nofree memory(none) define void @load_dereferenceable_not_dominating(ptr %p) { #0: %a = load ptr, ptr %p, align 8 call void @use.ptr(ptr %a) nofree memory(none) call void @use.ptr(ptr %a) nofree memory(none) ret void } Transformation seems to be correct! -- 48. PassManager<Function> : Skipping NOP -- 49. PassManager<Function> : Skipping NOP -- 50. GVNPass ---------------------------------------- declare void @use.i64(i64) nofree memory(none) define void @load_ptr_nonnull_to_i64(ptr %p) { #0: %val = load ptr, ptr %p, align 8 %val_nonnull = !nonnull ptr %val %val.int = ptrtoint ptr %val_nonnull to i64 %val2 = load i64, ptr %p, align 8 call void @use.i64(i64 %val.int) nofree memory(none) call void @use.i64(i64 %val2) nofree memory(none) ret void } Transformation seems to be correct! (syntactically equal) -- 51. GVNPass ---------------------------------------- declare void @use.i64(i64) nofree memory(none) define void @load_ptr_nonnull_to_i64(ptr %p) { #0: %val = load ptr, ptr %p, align 8 %val_nonnull = !nonnull ptr %val %val.int = ptrtoint ptr %val_nonnull to i64 %val2 = load i64, ptr %p, align 8 call void @use.i64(i64 %val.int) nofree memory(none) call void @use.i64(i64 %val2) nofree memory(none) ret void } => declare void @use.i64(i64) nofree memory(none) define void @load_ptr_nonnull_to_i64(ptr %p) { #0: %val = load ptr, ptr %p, align 8 %val.int = ptrtoint ptr %val to i64 call void @use.i64(i64 %val.int) nofree memory(none) call void @use.i64(i64 %val.int) nofree memory(none) ret void } Transformation doesn't verify! (unsound) ERROR: Source and target don't have the same return domain Example: ptr %p = pointer(non-local, block_id=1, offset=0) Source: ptr %val = poison ptr %val_nonnull = poison i64 %val.int = poison i64 %val2 = #x4000020000000000 (4611688217450643456) Function @use.i64 returned void = function did not return! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 8 alloc type: 0 alive: false address: 0 Block 1 > size: 8 align: 1 alloc type: 0 alive: true address: 8 Contents: *: #x4000020000000000 Block 2 > size: 5 align: 1 alloc type: 0 alive: true address: 2 Contents: *: #x4000020000000000 Target: ptr %val = poison i64 %val.int = poison Function @use.i64 returned Function @use.i64 returned Pass: GVNPass 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=gvn' '-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_G7RGtkpK_mfRW.bc" ------------------- SMT STATS ------------------- Num queries: 69 Num invalid: 0 Num skips: 0 Num trivial: 61 (46.9%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 46 (66.7%) Num UNSAT: 23 (33.3%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -S < /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/metadata.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/metadata.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/metadata.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/metadata.ll