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
Consider the following simple code:
@require test_fn2 :: proc(length: int) #no_bounds_check { arr1 := make([]int, length + 1) arr2 := make([]int, length + 1) for i := 0; i <= length; i += 1 { arr1[i] = arr2[i] } }
The compiler fails to vectorize it or turn it into a memcpy. If the loop end condition is modified to be just <, it gets vectorized:
<
for i := 0; i < length; i += 1 { // vectorizes
Link to compiler explorer: https://compiler-explorer.com/z/TM74EcfKh
odin report
Odin: dev-2024-12-nightly OS: Manjaro Linux, Linux 6.6.63-1-MANJARO CPU: AMD Ryzen 7 4700U with Radeon Graphics RAM: 15355 MiB Backend: LLVM 18.1.6
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
Consider the following simple code:
The compiler fails to vectorize it or turn it into a memcpy. If the loop end condition is modified to be just
<
, it gets vectorized:Link to compiler explorer: https://compiler-explorer.com/z/TM74EcfKh
odin report
output:The text was updated successfully, but these errors were encountered: