[PATCH] D152279: [Driver] Default -msmall-data-limit= to 0

Alex Bradbury via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 14 01:31:28 PDT 2023


asb added a comment.

In D152279#4415974 <https://reviews.llvm.org/D152279#4415974>, @MaskRay wrote:

> However, RISC-V `-msmall-data-limit=` is probably a case warranting a difference.
> The global pointer relaxation has a very limited value (benchmarked by multiple parties, including a party which implemented this feature in the GNU toolchain: even they can only say the optimization only applies to very specific projects).
> The default value is confusing: as explained by the summary.
>
> I suspect that `-msmall-data-limit=8` is too conservative, maybe 16 would be better, I don't know. I think global pointer relaxation users should toggle this by themselves, not relying on `0` or `8` default decided by a bunch of strange conditions.

I don't disagree that the small data limit being 8 rather than something else doesn't seem to be particularly well motivated, but I understand that the case where the option does make a difference is on embedded targets (I think the data that was shared before was for SPEC, but could be wrong?). I think we can generally expect more willingness for people targeting embedded systems to explore different compiler flags, but just matching gcc does feel like a better default. What do you think about keeping the default for bare metal targets?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152279/new/

https://reviews.llvm.org/D152279



More information about the cfe-commits mailing list