-
Notifications
You must be signed in to change notification settings - Fork 13.3k
closure doesn't seem to inherit the target attributes for codegen purposes #108338
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
the closure doesn't have any target features enabled, which isn't supposed to happen according to #73631. llvm ir before any llvm passes: https://godbolt.org/z/36fYKWbr8 link to original zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/weird.20codegen.20with.20_mm512_mask_loadu_epi64.20and.20lzcnt/near/329359963 |
This works correctly if you add |
…eature, r=Mark-Simulacrum Add assembly test to make sure that inlining works as expected when closures inherit target features Closes rust-lang#108338 (the added test proves that it is working correctly)
…eature, r=Mark-Simulacrum Add assembly test to make sure that inlining works as expected when closures inherit target features Closes rust-lang#108338 (the added test proves that it is working correctly)
…ture, r=Mark-Simulacrum Add assembly test to make sure that inlining works as expected when closures inherit target features Closes rust-lang#108338 (the added test proves that it is working correctly)
…ark-Simulacrum Add assembly test to make sure that inlining works as expected when closures inherit target features Closes rust-lang/rust#108338 (the added test proves that it is working correctly)
I tried this code:
I expected to see this happen: all the avx512f functions get inlined into
test
Instead, this happened:
_mm512_mask_loadu_epi64
did not get inlined intotest
codegen: https://godbolt.org/z/PbvexEWd8
here's a repro that mostly doesn't depend on std
codegen: https://godbolt.org/z/joG9xxq4c
there seem to be quite a few moving parts here.
lzcnt
feature (or replace it with a feature that is implied by avx512f),asm_fn
,do_nothing
,the function gets inlined as expected, so i'm not sure which is the culprit here
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: