[all-commits] [llvm/llvm-project] bf2a6a: Fix missing error for use of 128-bit integer insid...

jyu2-git via All-commits all-commits at lists.llvm.org
Fri Dec 4 14:35:04 PST 2020


  Branch: refs/heads/maste
  Home:   https://github.com/llvm/llvm-project
  Commit: bf2a6a3326761af4a5ff4836de2b62df0d7a44b6
      https://github.com/llvm/llvm-project/commit/bf2a6a3326761af4a5ff4836de2b62df0d7a44b6
  Author: Jennifer Yu <jennifer.yu at intel.com>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

  Changed paths:
    M clang/lib/Basic/Targets/SPIR.h
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/test/CodeGen/ext-int-cc.c
    A clang/test/SemaSYCL/int128.cpp

  Log Message:
  -----------
  Fix missing error for use of 128-bit integer inside SPIR64 device code.
Emit error for use of 128-bit integer inside device code had been
already implemented in https://reviews.llvm.org/D74387.  However,
the error is not emitted for SPIR64, because for SPIR64, hasInt128Type
return true.

hasInt128Type: is also used to control generation of certain 128-bit
predefined macros, initializer predefined 128-bit integer types and
build 128-bit ArithmeticTypes.  Except predefined macros, only the
device target is considered, since error only emit when 128-bit
integer is used inside device code, the host target (auxtarget) also
needs to be considered.

The change address:
1. (SPIR.h) Correct hasInt128Type() for SPIR targets.
2. Sema.cpp and SemaOverload.cpp: Add additional check to consider host
   target(auxtarget) when call to hasInt128Type.  So that __int128_t
   and __int128() are allowed to avoid error when they used outside
   device code.
3. SemaType.cpp: add check for SYCLIsDevice to delay the error message.
   The error will be emitted if the use of 128-bit integer in the device
   code.




More information about the All-commits mailing list