[PATCH] D122963: [X86] Extend the integer parameter if the function isn't local linked

LiuChen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 19:42:21 PDT 2022


LiuChen3 added a comment.

It seems we all agree we should extend the parameter both in caller and in callee. This is also the behavior of gcc.
For now, the front-end doesn't have an accurate attribute that describes what we're expecting right now and doesn't know whether the function is external linked. By default clang will do the extension only in the caller. This forced us to do some workarounds on the backend.
We also thought about setting these attributes correctly in the IPO, but is there any possibility that IPO won't do in some cases?
D112942 <https://reviews.llvm.org/D112942> introduces a new parameter attribute `NoExt` might help us. But this still means that by default, we will do extension in both caller and callee. And only in some optimization cases, we will do extension in caller or callee. Still not the ideal method that lebedev.ri expected.
Besides, I think that as an ABI issue, the correctness should be guaranteed first, optimization is not always guaranteed.
@lebedev.ri, is there any better approach to fix this issue?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122963



More information about the llvm-commits mailing list