-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Big compile time regression for Hexagon Linux kernel build after commit 90ba33099c #80185
Comments
@nathanchance, can you please share the reduced test case? We can investigate if there is anything in Hexagon backend side which might be causing this regression. |
@SundeepKushwaha Sure thing, it was: from the original message but that definitely could have been more noticeable on my part. It has some pretty lengthy macro expansions so I didn't want to copy and paste it into the thread. |
Optimized IR for the test case: https://gist.github.com/nikic/4061005b5d69328811c3593f55e59c49 Running |
Thanks @nikic and @nathanchance. @iajbar, can you please investigate? |
We are working on upstreaming the fix very soon. Thanks @nikic and @nathanchance. |
#81071 - the fix is merged @nikic @nathanchance |
Thanks, my build times agree. |
@llvm/issue-subscribers-backend-hexagon Author: Nathan Chancellor (nathanchance)
After https://github.com/llvm/llvm-project/commit/90ba33099cbb17e7c159e9ebc5a512037db99d6d, I see a very noticeable build time regression when building [`drivers/net/wireless/ralink/rt2x00/rt2800lib.c`](https://elixir.bootlin.com/linux/v6.8-rc2/source/drivers/net/wireless/ralink/rt2x00/rt2800lib.c) from the Linux kernel for `ARCH=hexagon` at `-O2`. I am still teasing out a concise reproducer but my reduction is taking quite long so I am just posting what I have so far to raise visibility on this. I'll post a potentially more concise reproducer once my reduction finishes.
With a base command of
This appears related to the compile time cc @nikic @androm3da @SundeepKushwaha @SidManning <details>
</details> |
Unfortunately, after commit 1a78f8cb5daa ("fortify: Allow KUnit test to build without FORTIFY") in the Linux kernel, which allows another test file to be built for Hexagon where it previously was not and was merged around the same time as the above fix, I am noticing a very similar pathological compile time impact of 90ba330, which is not cured by ac05771. If I should open a separate issue for this and reclose this one, I am more than happy to.
While this is a test file that has a lot of macro expansions for concise test case writing, I think over ten minutes might be a little excessive. Unfortunately, in my quest to come up with a concise reproducer, I have ended up creating something larger than the original test case :) so I have just gone ahead and attached the original preprocessed file from the kernel tree. It can be built with
to demonstrate the behavior. |
Thank you Nathan. We are working on debugging it. |
After 90ba330, I see a very noticeable build time regression when building
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
from the Linux kernel forARCH=hexagon
at-O2
. I am still teasing out a concise reproducer but my reduction is taking quite long so I am just posting what I have so far to raise visibility on this. I'll post a potentially more concise reproducer once my reduction finishes.With a base command of
clang -fno-short-enums --target=hexagon-linux-musl -O2 -c -o /dev/null rt2800lib.i
:rt2800lib.i.txt
This appears related to the compile time
ffs()
macros this driver has implemented, based on the massive amount of__builtin_choose_expr()
calls there are, asFIELD32
expands tocompile_ffs32
, which ultimately expands all of the othercompile_ffs
macros down tocompile_ffs2
... Perhaps the kernel should not be doing this (and that's reflected in the original baseline of42s
) but I think a 60x compile time regression should not happen either. I have not seen this level of regression in any of my other builds for other architectures, so perhaps this is related to something specific to Hexagon?cc @nikic @androm3da @SundeepKushwaha @SidManning
Bisect log
The text was updated successfully, but these errors were encountered: