You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test: Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll
Summary: Once DSE finds a store that is OOB, and therefore the function triggers UB, it removes all stores. However, in the program below OOB only happens if %c = true.
When %c=false there's no UB and therefore the store cannot be removed.
Extended Description
Test: Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll
Summary: Once DSE finds a store that is OOB, and therefore the function triggers UB, it removes all stores. However, in the program below OOB only happens if %c = true.
When %c=false there's no UB and therefore the store cannot be removed.
define i32 @test_out_of_bounds_store_nonlocal(i1 %c) {
%0:
%d = alloca i64 4, align 4
br label %for.body
%for.body:
%arrayidx = gep inbounds * %d, 4 x i64 0, 4 x i64 0
store i32 10, * %arrayidx, align 4
br label %for.inc
%for.inc:
br i1 %c, label %for.body.1, label %for.end
%for.body.1:
%arrayidx.1 = gep inbounds * %d, 4 x i64 0, 4 x i64 1
store i32 20, * %arrayidx.1, align 4
ret i32 1
%for.end:
%arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
%lv1 = load i32, * %arrayidx1, align 4
call void @use(i32 %lv1)
ret i32 0
}
=>
define i32 @test_out_of_bounds_store_nonlocal(i1 %c) {
%0:
%d = alloca i64 4, align 4
br label %for.body
%for.body:
br label %for.inc
%for.inc:
br i1 %c, label %for.body.1, label %for.end
%for.body.1:
ret i32 1
%for.end:
%arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
%lv1 = load i32, * %arrayidx1, align 4
call void @use(i32 %lv1)
ret i32 0
}
Transformation doesn't verify!
ERROR: Source is more defined than target
Example:
i1 %c = #x0 (0)
Source:
i32 %lv1 = #x0000000a (10)
Target:
i32 %lv1 = poison
https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=4b7777d913fed80c&test=Transforms%2FDeadStoreElimination%2FMSSA%2Fout-of-bounds-stores.ll
The text was updated successfully, but these errors were encountered: