[all-commits] [llvm/llvm-project] 2831a3: Implement AVX ABI Warning/error

Erich Keane via All-commits all-commits at lists.llvm.org
Wed Jul 1 07:14:58 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2831a317b689c7f005a29f008a8e4c24485c0711
      https://github.com/llvm/llvm-project/commit/2831a317b689c7f005a29f008a8e4c24485c0711
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2020-07-01 (Wed, 01 Jul 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticFrontendKinds.td
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/CodeGen/TargetInfo.h
    A clang/test/CodeGen/target-avx-abi-diag.c
    M clang/test/CodeGen/target-builtin-error-3.c
    M clang/test/CodeGen/target-builtin-noerror.c

  Log Message:
  -----------
  Implement AVX ABI Warning/error

The x86-64 "avx" feature changes how >128 bit vector types are passed,
instead of being passed in separate 128 bit registers, they can be
passed in 256 bit registers.

"avx512f" does the same thing, except it switches from 256 bit registers
to 512 bit registers.

The result of both of these is an ABI incompatibility between functions
compiled with and without these features.

This patch implements a warning/error pair upon an attempt to call a
function that would run afoul of this. First, if a function is called
that would have its ABI changed, we issue a warning.

Second, if said call is made in a situation where the caller and callee
are known to have different calling conventions (such as the case of
'target'), we instead issue an error.

Differential Revision: https://reviews.llvm.org/D82562




More information about the All-commits mailing list