We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll
MemCpyOpt sign-extends the difference between memcpy/memset sizes instead of zero-extending them.
https://alive2.llvm.org/ce/z/RgKeyt
define void @src(* %dst, * %src, i8 %dst_size, i8 %src_size, i8 %c) { memset * %dst align 1, i8 %c, i8 %dst_size memcpy * %dst align 1, * %src align 1, i8 %src_size ret void } => define void @src(* %dst, * %src, i8 %dst_size, i8 %src_size, i8 %c) { %1 = usub_sat i8 %dst_size, %src_size %2 = sext i8 %src_size to i64 %3 = gep * %dst, 1 x i64 %2 memset * %3 align 1, i8 %c, i8 %1 memcpy * %dst align 1, * %src align 1, i8 %src_size ret void } Transformation doesn't verify! ERROR: Source is more defined than target
Example:
Source:
NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 Block 1 > size: 2305843009213693952 align: 2 alloc type: 0 Block 2 > align: 2 alloc type: 0
Target: i8 %1 = #x01 (1) i64 %2 = #xffffffffffffff82 (18446744073709551490, -126)
Summary: 0 correct transformations 1 incorrect transformations 0 Alive2 errors
https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=1546033e6d866cfc&test=Transforms%2FMemCpyOpt%2Fmemset-memcpy-redundant-memset.ll
The text was updated successfully, but these errors were encountered:
Looks like this issue no longer exists (zext is used).
Sorry, something went wrong.
No branches or pull requests
Extended Description
Test: Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll
MemCpyOpt sign-extends the difference between memcpy/memset sizes instead of zero-extending them.
https://alive2.llvm.org/ce/z/RgKeyt
define void @src(* %dst, * %src, i8 %dst_size, i8 %src_size, i8 %c) {
memset * %dst align 1, i8 %c, i8 %dst_size
memcpy * %dst align 1, * %src align 1, i8 %src_size
ret void
}
=>
define void @src(* %dst, * %src, i8 %dst_size, i8 %src_size, i8 %c) {
%1 = usub_sat i8 %dst_size, %src_size
%2 = sext i8 %src_size to i64
%3 = gep * %dst, 1 x i64 %2
memset * %3 align 1, i8 %c, i8 %1
memcpy * %dst align 1, * %src align 1, i8 %src_size
ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target
Example:
i8 %dst_size = #x83 (131, -125)
i8 %src_size = #x82 (130, -126)
i8 %c = any
Source:
SOURCE MEMORY STATE
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0
Block 1 > size: 2305843009213693952 align: 2 alloc type: 0
Block 2 > align: 2 alloc type: 0
Target:
i8 %1 = #x01 (1)
i64 %2 = #xffffffffffffff82 (18446744073709551490, -126)
Summary:
0 correct transformations
1 incorrect transformations
0 Alive2 errors
https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=1546033e6d866cfc&test=Transforms%2FMemCpyOpt%2Fmemset-memcpy-redundant-memset.ll
The text was updated successfully, but these errors were encountered: