You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Clang] Support using boolean vectors in ternary operators (#154145)
Summary:
It's extremely common to conditionally blend two vectors. Previously
this was done with mask registers, which is what the normal ternary code
generation does when used on a vector. However, since Clang 15 we have
supported boolean vector types in the compiler. These are useful in
general for checking the mask registers, but are currently limited
because they do not map to an LLVM-IR select instruction.
This patch simply relaxes these checks, which are technically forbidden
by
the OpenCL standard. However, general vector support should be able to
handle these. We already support this for Arm SVE types, so this should
be make more consistent with the clang vector type.
Copy file name to clipboardExpand all lines: clang/docs/ReleaseNotes.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,12 +137,14 @@ Non-comprehensive list of changes in this release
137
137
- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can
138
138
now be used in constant expressions.
139
139
140
+
- A vector of booleans is now a valid condition for the ternary ``?:`` operator.
141
+
This binds to a simple vector select operation.
142
+
140
143
- Use of ``__has_feature`` to detect the ``ptrauth_qualifier`` and ``ptrauth_intrinsics``
141
144
features has been deprecated, and is restricted to the arm64e target only. The
142
145
correct method to check for these features is to test for the ``__PTRAUTH__``
143
146
macro.
144
147
145
-
146
148
New Compiler Flags
147
149
------------------
148
150
- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
0 commit comments