[PATCH] D124435: [X86] Always extend the integer parameters in callee

LiuChen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 00:28:49 PDT 2022


LiuChen3 added inline comments.


================
Comment at: clang/docs/ClangCommandLineReference.rst:2988-2992
+.. option:: -mconservative-extend
+Always extend the integer parameter both in the callee and caller.
+
+.. option:: -mno-conservative-extend
+Keep the original integer parameter passing behavior.
----------------
LiuChen3 wrote:
> rjmccall wrote:
> > pengfei wrote:
> > > Combine like others?
> > How about:
> > 
> > ```
> > In the past, Clang passed small integer arguments on certain targets using a
> > parameter convention in which the caller was assumed to have sign-extended
> > or zero-extended the argument to a certain width.  This convention was not
> > conformant with the documented ABI on these platforms, which does not
> > require the caller to perform this extension.  Clang no longer assumes that
> > callers perform this extension, but for compatibility with code compiled by
> > previous releases of Clang, Clang defaults to still extending the argument in the
> > caller.  `-mno-conservative-extend` disables this, which may improve
> > performance and code size if compatibility with old versions of Clang is not
> > required.
> > 
> > This affects most 32-bit and 64-bit x86 targets, except:
> > - Windows, which Clang has never assumed extension on
> > - Apple platforms, which use a non-standard ABI that unconditionally assumes extension
> > ```
> > 
> > Note that I need to check that that's what Apple actually wants to do.  You should also reach out to the Sony folks to see what they want to do, but I expect that it's to assume extension unconditionally.
> Thanks a lot! It's much clearer.
> Just a small correction for windows: only windows64 is not affected.
Hi, @RKSimon , @probinson.  This patch will extend the integer parameters in the caller.  Is there any concern about this for Sony?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124435



More information about the cfe-commits mailing list