[PATCH] D89400: [SimplifyLibCalls] Keep calling convention when simplifying to libcall

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 15:38:21 PDT 2020


efriedma added a comment.

> Remove the behaviour that the calling-convention is non-C when there's a mismatch between the triple and the float-abi and do something different to make sure we end up with the right calling convention in the end (maybe have -mfloat-abi implicitly modify the triple like -march and -mcpu do).

I would lean towards doing this.

The alternative is that we add module metadata or something like that to specify the "C" calling convention in LLVM IR.  And I don't really want to go there if we can avoid it.  (I can't think of any reason it would be better than messing with the triple on ARM.)

Note that we do currently have TargetOptions::FloatABIType.  But that doesn't really work with LTO.

> Add special handling to make sure C library calls only get the C calling convention and add some mechanism to signal to the backend what the actual calling convention is.

Special-casing C library functions seems more complicated for no benefit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89400



More information about the llvm-commits mailing list