-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Clang] Honor -flax-vector-conversions=none on some tests #153433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mikolaj-pirog
merged 3 commits into
llvm:main
from
mikolaj-pirog:mpirog/fix_flax_tests_1
Aug 14, 2025
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| // RUN: %clang_cc1 %s -emit-llvm -o - | ||
| // RUN: %clang_cc1 %s -emit-llvm -flax-vector-conversions=none -o - | ||
|
|
||
| typedef float __m128 __attribute__((__vector_size__(16))); | ||
| typedef long long __v2di __attribute__((__vector_size__(16))); | ||
| typedef int __v4si __attribute__((__vector_size__(16))); | ||
|
|
||
| __v2di bar(void); | ||
| __v2di bar(void); | ||
| void foo(int X, __v4si *P) { | ||
| *P = X == 2 ? bar() : bar(); | ||
| *P = X == 2 ? (__v4si)(bar()) : (__v4si)(bar()); | ||
mikolaj-pirog marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| // REQUIRES: x86-registered-target | ||
| // RUN: %clang_cc1 %s -triple=i686-apple-darwin -target-feature +ssse3 -O1 -S -o - | FileCheck %s | ||
| // RUN: %clang_cc1 %s -triple=i686-apple-darwin -target-feature +ssse3 -O1 -S -flax-vector-conversions=none -o - | FileCheck %s | ||
|
|
||
| #define _mm_alignr_epi8(a, b, n) (__builtin_ia32_palignr128((a), (b), (n))) | ||
| typedef __attribute__((vector_size(16))) int int4; | ||
| typedef char __v16qi __attribute__((__vector_size__(16))); | ||
|
|
||
| // CHECK: palignr $15, %xmm1, %xmm0 | ||
| int4 align1(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 15); } | ||
| __v16qi align1(__v16qi a, __v16qi b) { return _mm_alignr_epi8(a, b, 15); } | ||
mikolaj-pirog marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // CHECK: ret | ||
| // CHECK: ret | ||
| // CHECK-NOT: palignr | ||
| int4 align2(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 16); } | ||
| __v16qi align2(__v16qi a, __v16qi b) { return _mm_alignr_epi8(a, b, 16); } | ||
| // CHECK: psrldq $1, %xmm0 | ||
| int4 align3(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 17); } | ||
| __v16qi align3(__v16qi a, __v16qi b) { return _mm_alignr_epi8(a, b, 17); } | ||
| // CHECK: xor | ||
| int4 align4(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 32); } | ||
| __v16qi align4(__v16qi a, __v16qi b) { return _mm_alignr_epi8(a, b, 32); } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.