Skip to content
New issue

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

Missed optimization when computing fma #112192

Closed
icedrocket opened this issue Jun 1, 2023 · 2 comments
Closed

Missed optimization when computing fma #112192

icedrocket opened this issue Jun 1, 2023 · 2 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@icedrocket
Copy link
Contributor

icedrocket commented Jun 1, 2023

It optimizes well when the fma is computed explicitly with f32::mul_add(), but not when it is not, like x * y + z.

https://godbolt.org/z/fh74x4W88

@saethlin saethlin added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-slow Issue: Problems and improvements with respect to performance of generated code. labels Jun 2, 2023
@workingjubilee
Copy link
Member

That is a result-changing optimization, so the optimization is not permissible. Otherwise, this is a duplicate of e.g. #21690

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@workingjubilee workingjubilee removed the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Jun 2, 2023
@workingjubilee
Copy link
Member

And there is no LLVM bug here: we don't ask LLVM to do results-changing optimizations, so it doesn't. We would need to define this optimization as acceptable on the Rust language, first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

3 participants