[PATCH] D38341: [compiler-rt] Add back ARM EABI aliases where legal.

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 19:39:19 PDT 2017


compnerd requested changes to this revision.
compnerd added a comment.
This revision now requires changes to proceed.

These functions would only really compile down to an additional branch.  I can understand the desire to micro-optimize away the additional branch.  However, I think that I would rather that the following pattern is used:

  #if defined(__ARM_EABI__)
  #if defined(COMPILER_RT_ARMHF_TARGET)
  AEABI_RTABI uint16_t __aeabi_f2h(float a) {
    return __truncsfhf2(a);
  }
  #else
  AEABI_RTABI uint16_t __aeabi_f2h(float a) __attribute__((__alias__("__truncsfhf2")));
  #endif
  #endif

This way the signature information is fully preserved in what LLVM seems.  Otherwise, it just so happens that the compiler backend doesn't change the parameter registers, but is free to do so.  I would be happy with a `COMPILER_RT_ALIAS` macro as:

  #define COMPILER_RT_ALIAS(aliasee) __attribute__((__alias__(#aliasee)))

to use in place of the alias attribute.


Repository:
  rL LLVM

https://reviews.llvm.org/D38341





More information about the llvm-commits mailing list