[all-commits] [llvm/llvm-project] fc8d37: [ExtVectorType] Support conditional select operato...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Mar 9 05:09:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc8d3766d721ebc075e16814e48adf48034ea858
      https://github.com/llvm/llvm-project/commit/fc8d3766d721ebc075e16814e48adf48034ea858
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaExprCXX.cpp
    A clang/test/CodeGenCXX/ext-vector-type-conditional.cpp
    R clang/test/CodeGenCXX/vector-conditional.cpp
    A clang/test/CodeGenCXX/vector-size-conditional.cpp
    A clang/test/SemaCXX/ext-vector-type-conditional.cpp
    R clang/test/SemaCXX/vector-conditional.cpp
    A clang/test/SemaCXX/vector-size-conditional.cpp

  Log Message:
  -----------
  [ExtVectorType] Support conditional select operator for C++.

This patch implements the conditional select operator for
ext_vector_types in C++. It does so by using the same semantics as for
C.

D71463 added support for the conditional select operator for VectorType
in C++. Unfortunately the semantics between ext_vector_type in C are
different to VectorType in C++. Select for ext_vector_type is based on
the MSB of the condition vector, whereas for VectorType it is `!= 0`.

This unfortunately means that the behavior is inconsistent between
ExtVectorType and VectorType, but I think using the C semantics for
ExtVectorType in C++ as well should be less surprising for users.

Reviewed By: erichkeane, aaron.ballman

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




More information about the All-commits mailing list