Test Failure: Transforms/Sink/call.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @test_sink_no_stores(i1 %z) {
%0:
  %l = call i32 @f_load_global() nowrite nofree willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
define i32 @test_sink_no_stores(i1 %z) {
%0:
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  %l = call i32 @f_load_global() nowrite nofree willreturn
  ret i32 %l
}
Transformation seems to be correct!


----------------------------------------
define i32 @test_throwable_no_stores(i1 %z) {
%0:
  %l = call i32 @f_load_global_throwable() nowrite nofree willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
define i32 @test_throwable_no_stores(i1 %z) {
%0:
  %l = call i32 @f_load_global_throwable() nowrite nofree willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
define i32 @test_may_not_return_no_stores(i1 %z) {
%0:
  %l = call i32 @f_load_global_may_not_return() nowrite nofree
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
define i32 @test_may_not_return_no_stores(i1 %z) {
%0:
  %l = call i32 @f_load_global_may_not_return() nowrite nofree
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
Transformation seems to be correct! (syntactically equal)


----------------------------------------
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i32 @test_sink_argmem_store(i1 %z) {
%0:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  store i32 0, * @B, align 4
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
@B = global 4 bytes, align 4
@A = global 4 bytes, align 4

define i32 @test_sink_argmem_store(i1 %z) {
%0:
  store i32 0, * @B, align 4
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  ret i32 %l
}
Transformation seems to be correct!


----------------------------------------
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i32 @test_sink_argmem_call(i1 %z) {
%0:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  call void @f_store_arg(* @B) argmemonly willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
@B = global 4 bytes, align 4
@A = global 4 bytes, align 4

define i32 @test_sink_argmem_call(i1 %z) {
%0:
  call void @f_store_arg(* @B) argmemonly willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  ret i32 %l
}
Transformation seems to be correct!


----------------------------------------
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i32 @test_sink_argmem_multiple(i1 %z) {
%0:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  call void @f_readonly_arg(* @A, * @B) argmemonly willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  ret i32 %l
}
=>
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i32 @test_sink_argmem_multiple(i1 %z) {
%0:
  call void @f_readonly_arg(* @A, * @B) argmemonly willreturn
  br i1 %z, label %true, label %false

%false:
  ret i32 0

%true:
  %l = call i32 @f_load_arg(* @A) nowrite argmemonly nofree willreturn
  ret i32 %l
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %z = #x1 (1)

Source:
i32 %l = poison
  >> Jump to %true

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0
Block 1 >	size: 4	align: 4	alloc type: 0
Block 2 >	size: 4	align: 4	alloc type: 0
Block 3 >	size: 4	align: 4	alloc type: 0

Target:
  >> Jump to %true
i32 %l = UB triggered!



------------------- SMT STATS -------------------
Num queries: 17
Num invalid: 0
Num skips:   0
Num trivial: 16 (48.5%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     14 (82.4%)
Num UNSAT:   3 (17.6%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/Sink/call.ll
+ /home/nuno/alive2/build/opt-alive.sh -basic-aa -sink -S

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/Sink/call.ll

 

<-- Back