Commit 0e67cc1
committed
[Clang] Support using boolean vectors in ternary operators
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 adds 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.1 parent 8f0da9b commit 0e67cc1
File tree
7 files changed
+178
-205
lines changed- clang
- docs
- lib
- CodeGen
- Sema
- test/CodeGenCXX
7 files changed
+178
-205
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
660 | 670 | | |
661 | 671 | | |
662 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5558 | 5558 | | |
5559 | 5559 | | |
5560 | 5560 | | |
5561 | | - | |
5562 | | - | |
| 5561 | + | |
| 5562 | + | |
5563 | 5563 | | |
5564 | 5564 | | |
5565 | 5565 | | |
| |||
5608 | 5608 | | |
5609 | 5609 | | |
5610 | 5610 | | |
5611 | | - | |
5612 | 5611 | | |
| 5612 | + | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
5613 | 5616 | | |
5614 | 5617 | | |
5615 | 5618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8434 | 8434 | | |
8435 | 8435 | | |
8436 | 8436 | | |
8437 | | - | |
| 8437 | + | |
| 8438 | + | |
| 8439 | + | |
8438 | 8440 | | |
8439 | | - | |
| 8441 | + | |
8440 | 8442 | | |
8441 | 8443 | | |
8442 | 8444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5753 | 5753 | | |
5754 | 5754 | | |
5755 | 5755 | | |
| 5756 | + | |
5756 | 5757 | | |
5757 | | - | |
5758 | | - | |
5759 | | - | |
| 5758 | + | |
| 5759 | + | |
| 5760 | + | |
| 5761 | + | |
5760 | 5762 | | |
5761 | 5763 | | |
5762 | 5764 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
0 commit comments