Skip to content

Conversation

@mikolaj-pirog
Copy link
Member

As in title. This is done as a step towards enabling the -flax-vector-conversions=none globally as a default

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:bytecode Issues for the clang bytecode constexpr interpreter labels Aug 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 13, 2025

@llvm/pr-subscribers-clang

Author: Mikołaj Piróg (mikolaj-pirog)

Changes

As in title. This is done as a step towards enabling the -flax-vector-conversions=none globally as a default


Full diff: https://github.com/llvm/llvm-project/pull/153433.diff

3 Files Affected:

  • (modified) clang/test/AST/ByteCode/vectors.cpp (+2-7)
  • (modified) clang/test/CodeGen/2007-01-20-VectorICE.c (+3-3)
  • (modified) clang/test/CodeGen/palignr.c (+6-6)
diff --git a/clang/test/AST/ByteCode/vectors.cpp b/clang/test/AST/ByteCode/vectors.cpp
index a04b678a623a1..4e359b0f8cee8 100644
--- a/clang/test/AST/ByteCode/vectors.cpp
+++ b/clang/test/AST/ByteCode/vectors.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both %s
-// RUN: %clang_cc1 -verify=ref,both %s
+// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -flax-vector-conversions=none %s
+// RUN: %clang_cc1 -verify=ref,both -flax-vector-conversions=none %s
 
 typedef int __attribute__((vector_size(16))) VI4;
 constexpr VI4 A = {1,2,3,4};
@@ -56,11 +56,6 @@ namespace Vector {
   static_assert(__builtin_vectorelements(v2) == (32 / sizeof(double)), "");
 }
 
-namespace {
-  typedef float __attribute__((vector_size(16))) VI42;
-  constexpr VI42 A2 = A;
-}
-
 namespace BoolToSignedIntegralCast{
   typedef __attribute__((__ext_vector_type__(4))) unsigned int int4;
   constexpr int4 intsT = (int4)true;
diff --git a/clang/test/CodeGen/2007-01-20-VectorICE.c b/clang/test/CodeGen/2007-01-20-VectorICE.c
index 286b8a1b3de08..15790c1726660 100644
--- a/clang/test/CodeGen/2007-01-20-VectorICE.c
+++ b/clang/test/CodeGen/2007-01-20-VectorICE.c
@@ -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());
 }
 
diff --git a/clang/test/CodeGen/palignr.c b/clang/test/CodeGen/palignr.c
index 092937ac115de..fa6e880c9d4ff 100644
--- a/clang/test/CodeGen/palignr.c
+++ b/clang/test/CodeGen/palignr.c
@@ -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 long long __m128i __attribute__((__vector_size__(16), __aligned__(16)));
 
 // CHECK: palignr $15, %xmm1, %xmm0
-int4 align1(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 15); }
+__m128i align1(__m128i a, __m128i b) { return _mm_alignr_epi8(a, b, 15); }
 // CHECK: ret
 // CHECK: ret
 // CHECK-NOT: palignr
-int4 align2(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 16); }
+__m128i align2(__m128i a, __m128i 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); }
+__m128i align3(__m128i a, __m128i b) { return _mm_alignr_epi8(a, b, 17); }
 // CHECK: xor
-int4 align4(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 32); }
+__m128i align4(__m128i a, __m128i b) { return _mm_alignr_epi8(a, b, 32); }

Copy link
Contributor

@phoebewang phoebewang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mikolaj-pirog mikolaj-pirog merged commit 768eae7 into llvm:main Aug 14, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 14, 2025

LLVM Buildbot has detected a new failure on builder clangd-ubuntu-tsan running on clangd-ubuntu-clang while building clang at step 2 "checkout".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/134/builds/24409

Here is the relevant piece of the build log for the reference
Step 2 (checkout) failure: update (failure)
git version 2.17.1
fatal: unable to access 'https://github.com/llvm/llvm-project.git/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/llvm/llvm-project.git/': Could not resolve host: github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bytecode Issues for the clang bytecode constexpr interpreter clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants