llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) <details> <summary>Changes</summary> Sema allows vectors of _BitInt(N) as long as N is a power-of-two. This change adds a power-of-two check for _BitInt elements in vector types and implements lowering of such vectors to LLVM. CIR calling convention lowering hits an NYI case if these vectors appear in function signatures, so the test disables calling convention lowering for now. That will be fixed in an upcoming change. This change eliminated most of the unsupported cases in `unsupported-initializer-types.cir` and `unsupported-type-conversions.cir` so those tests are being deleted. The test cases from those files that are still relevant were moved into `unlowered-address-spaces.cir`. Assisted-by: Cursor / claude-opus-5.5 --- Patch is 21.26 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/244412.diff 7 Files Affected: - (modified) clang/lib/CIR/Dialect/IR/CIRTypes.cpp (+5) - (modified) clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp (-6) - (added) clang/test/CIR/CodeGen/bitint-vector.c (+83) - (modified) clang/test/CIR/IR/invalid-vector.cir (+11) - (modified) clang/test/CIR/Lowering/unlowered-address-spaces.cir (+37-1) - (removed) clang/test/CIR/Lowering/unsupported-initializer-types.cir (-70) - (removed) clang/test/CIR/Lowering/unsupported-type-conversions.cir (-223) ``````````diff diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp index 4a60c362fddf2f..911a6142100a2d 100644 --- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp +++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp @@ -1673,6 +1673,11 @@ mlir::LogicalResult cir::VectorType::verify( mlir::Type elementType, llvm::ElementCount size) { if (size.isZero()) return emitError() << "the number of vector elements must be non-zero"; + if (auto intTy = mlir::dyn_cast<cir::IntType>(elementType); + intTy && intTy.isBitInt() && !llvm::isPowerOf2_32(intTy.getWidth())) + return emitError() << "a _BitInt vector element type must have a " + "power-of-2 width, got " + << elementType; return success(); } diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp index 4e4374154d23f1..7986de0d3245f6 100644 --- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp +++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp @@ -4584,12 +4584,6 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter, return mlir::LLVM::LLVMArrayType::get(ty, type.getSize()); }); converter.addConversion([&](cir::VectorType type) -> mlir::Type { - // Vector-of-_BitInt memory layout is not modeled here (the element would - // stay at its literal width); report a conversion failure rather than emit - // an unvalidated vector. - if (auto intTy = mlir::dyn_cast<cir::IntType>(type.getElementType()); - intTy && intTy.isBitInt()) - return {}; const mlir::Type ty = converter.convertType(type.getElementType()); if (!ty) return {}; diff --git a/clang/test/CIR/CodeGen/bitint-vector.c b/clang/test/CIR/CodeGen/bitint-vector.c new file mode 100644 index 00000000000000..376a03ddb12034 --- /dev/null +++ b/clang/test/CIR/CodeGen/bitint-vector.c @@ -0,0 +1,83 @@ +// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -fclangir -fno-clangir-call-conv-lowering -emit-cir %s -o %t.cir +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s +// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -fclangir -fno-clangir-call-conv-lowering -emit-llvm %s -o %t-cir.ll +// RUN: FileCheck --check-prefixes=LLVM,LLVMCIR --input-file=%t-cir.ll %s +// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -emit-llvm %s -o %t.ll +// RUN: FileCheck --check-prefixes=LLVM,OGCG --input-file=%t.ll %s + +// Vectors of _BitInt(N) hit an unimplemented case during calling convention +// lowering. This test should be updated to remove -fno-clangir-call-conv-lowering +// after that is fixed. + +// A vector of _BitInt(N) lowers to a vector of iN in both its value and its +// memory form, including when N is narrower than a byte. + +typedef _BitInt(32) v4s32 __attribute__((ext_vector_type(4))); +typedef unsigned _BitInt(16) v4u16 __attribute__((ext_vector_type(4))); +typedef unsigned _BitInt(4) v8u4 __attribute__((ext_vector_type(8))); +typedef _BitInt(128) v2s128 __attribute__((ext_vector_type(2))); +typedef float v4f __attribute__((ext_vector_type(4))); + +v4s32 g32 = {1, 2, -3, 4}; +v8u4 g4 = {0, 1, 2, 3, 12, 13, 14, 15}; +v2s128 g128; + +// CIR-DAG: cir.global external @g32 = #cir.const_vector<[#cir.int<1> : !s32i_bitint, #cir.int<2> : !s32i_bitint, #cir.int<-3> : !s32i_bitint, #cir.int<4> : !s32i_bitint]> : !cir.vector<4 x !s32i_bitint> align(16) +// CIR-DAG: cir.global external @g4 = #cir.const_vector<{{.*}}> : !cir.vector<8 x !cir.int<u, 4, bitint>> align(8) +// CIR-DAG: cir.global external @g128 = #cir.zero : !cir.vector<2 x !s128i_bitint> align(16) + +// LLVM-DAG: @g32 = global <4 x i32> <i32 1, i32 2, i32 -3, i32 4>, align 16 +// LLVM-DAG: @g4 = global <8 x i4> <i4 0, i4 1, i4 2, i4 3, i4 -4, i4 -3, i4 -2, i4 -1>, align 8 +// LLVM-DAG: @g128 = global <2 x i128> zeroinitializer, align 16 + +void arith(v8u4 *p, v2s128 *q) { + *p = *p * *p; + v2s128 v = *q; + v[1] = v[0] + 3; + *q = v; +} + +// CIR-LABEL: cir.func {{.*}} @arith +// CIR: cir.load {{.*}} : !cir.ptr<!cir.vector<8 x !cir.int<u, 4, bitint>>>, !cir.vector<8 x !cir.int<u, 4, bitint>> +// CIR: cir.mul %{{.*}}, %{{.*}} : !cir.vector<8 x !cir.int<u, 4, bitint>> +// CIR: cir.vec.extract %{{.*}}[%{{.*}} : !s32i] : !cir.vector<2 x !s128i_bitint> +// CIR: cir.vec.insert %{{.*}}, %{{.*}}[%{{.*}} : !s32i] : !cir.vector<2 x !s128i_bitint> + +// LLVM-LABEL: define {{.*}} void @arith +// LLVM: %[[A:.*]] = load <8 x i4>, ptr %{{.*}}, align 8 +// LLVM: %[[B:.*]] = load <8 x i4>, ptr %{{.*}}, align 8 +// LLVM: %[[MUL:.*]] = mul <8 x i4> %[[A]], %[[B]] +// LLVM: store <8 x i4> %[[MUL]], ptr %{{.*}}, align 8 +// LLVM: %[[V:.*]] = load <2 x i128>, ptr %{{.*}}, align 16 +// LLVM: store <2 x i128> %[[V]], ptr %{{.*}}, align 16 +// LLVM: %[[V0:.*]] = extractelement <2 x i128> %{{.*}}, i32 0 +// LLVM: %[[ADD:.*]] = add nsw i128 %[[V0]], 3 +// LLVM: insertelement <2 x i128> %{{.*}}, i128 %[[ADD]], i32 1 + +v4s32 select_min(v4s32 a, v4s32 b) { return a < b ? a : b; } + +// CIR-LABEL: cir.func {{.*}} @select_min(%{{.*}}: !cir.vector<4 x !s32i_bitint> {{.*}}, %{{.*}}: !cir.vector<4 x !s32i_bitint> {{.*}}) -> !cir.vector<4 x !s32i_bitint> +// CIR: cir.vec.cmp(lt, %{{.*}}, %{{.*}}) : !cir.vector<4 x !s32i_bitint>, !cir.vector<4 x !s32i> +// CIR: cir.vec.ternary(%{{.*}}, %{{.*}}, %{{.*}}) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i_bitint> + +// LLVM-LABEL: define {{.*}} <4 x i32> @select_min(<4 x i32> {{.*}}, <4 x i32> {{.*}}) +// LLVM: %[[CMP:.*]] = icmp slt <4 x i32> %{{.*}}, %{{.*}} +// LLVM: %[[MASK:.*]] = sext <4 x i1> %[[CMP]] to <4 x i32> +// LLVMCIR: %[[COND:.*]] = icmp ne <4 x i32> %[[MASK]], zeroinitializer +// OGCG: %[[COND:.*]] = icmp slt <4 x i32> %[[MASK]], zeroinitializer +// LLVM: select <4 x i1> %[[COND]], <4 x i32> %{{.*}}, <4 x i32> %{{.*}} + +v4f convert(v4s32 a) { + v4u16 t = __builtin_convertvector(a, v4u16); + return __builtin_convertvector(t, v4f); +} + +// CIR-LABEL: cir.func {{.*}} @convert +// CIR: cir.cast integral %{{.*}} : !cir.vector<4 x !s32i_bitint> -> !cir.vector<4 x !u16i_bitint> +// CIR: cir.cast int_to_float %{{.*}} : !cir.vector<4 x !u16i_bitint> -> !cir.vector<4 x !cir.float> + +// LLVM-LABEL: define {{.*}} <4 x float> @convert(<4 x i32> {{.*}}) +// LLVM: %[[T:.*]] = trunc <4 x i32> %{{.*}} to <4 x i16> +// LLVM: store <4 x i16> %[[T]], ptr %{{.*}}, align 8 +// LLVM: %[[T2:.*]] = load <4 x i16>, ptr %{{.*}}, align 8 +// LLVM: uitofp <4 x i16> %[[T2]] to <4 x float> diff --git a/clang/test/CIR/IR/invalid-vector.cir b/clang/test/CIR/IR/invalid-vector.cir index 3933b921b84e2a..6a4d8ee513b323 100644 --- a/clang/test/CIR/IR/invalid-vector.cir +++ b/clang/test/CIR/IR/invalid-vector.cir @@ -199,6 +199,17 @@ cir.global external @vec_a = #cir.zero : !cir.vector<0 x !s32i> // ----- +!s24i_bitint = !cir.int<s, 24, bitint> + +module { + +// expected-error @below {{a _BitInt vector element type must have a power-of-2 width, got '!cir.int<s, 24, bitint>'}} +cir.global external @vec_bitint = #cir.zero : !cir.vector<4 x !s24i_bitint> + +} + +// ----- + !s32i = !cir.int<s, 32> module { diff --git a/clang/test/CIR/Lowering/unlowered-address-spaces.cir b/clang/test/CIR/Lowering/unlowered-address-spaces.cir index 8a94b7b0457a44..f42f2c0394ac69 100644 --- a/clang/test/CIR/Lowering/unlowered-address-spaces.cir +++ b/clang/test/CIR/Lowering/unlowered-address-spaces.cir @@ -1,4 +1,4 @@ -// RUN: cir-opt %s --split-input-file --cir-to-llvm -verify-diagnostics +// RUN: cir-opt %s --split-input-file --cir-to-llvm -verify-diagnostics | FileCheck %s !s32i = !cir.int<s, 32> @@ -139,6 +139,29 @@ module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { // ----- +!langptr = !cir.ptr<!cir.int<s, 32>, lang_address_space(offload_global)> +!array = !cir.array<!langptr x 1> +!ptr = !cir.ptr<!cir.void> + +module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { + // Conversion failure rolls back the unresolved block address. Stop before + // attempting to resolve it against a label that has not been lowered. + // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.array<!cir.ptr<!cir.int<s, 32>, lang_address_space(offload_global)> x 1>' for symbol @target}} + // expected-error @below {{failed to legalize operation 'cir.global'}} + cir.global external @view = #cir.const_array<[#cir.block_addr_info<@f, "L"> : !ptr, #cir.global_view<@target, [0 : i32]> : !ptr]> : !cir.array<!ptr x 2> + + cir.func @f() { + cir.br ^bb1 + ^bb1: + cir.label "L" + cir.return + } + + cir.global external @target = #cir.zero : !array +} + +// ----- + !s32i = !cir.int<s, 32> module attributes {cir.triple = "spirv64-unknown-unknown"} { @@ -330,6 +353,19 @@ module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { // ----- +!s64i = !cir.int<s, 64> +!langptr = !cir.ptr<!cir.void, lang_address_space(offload_global)> +!rec_U = !cir.union<"U" {data !s64i, data !langptr}> + +module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { + // An inactive member that cannot be converted does not prevent lowering the + // union's integer storage. + // CHECK: llvm.mlir.global external @union_inactive_member_language_address_space + cir.global external @union_inactive_member_language_address_space = #cir.const_record<{#cir.int<0> : !s64i}> : !rec_U +} + +// ----- + !s32i = !cir.int<s, 32> module attributes {cir.triple = "spirv64-unknown-unknown"} { diff --git a/clang/test/CIR/Lowering/unsupported-initializer-types.cir b/clang/test/CIR/Lowering/unsupported-initializer-types.cir deleted file mode 100644 index 850bb8c7b486ff..00000000000000 --- a/clang/test/CIR/Lowering/unsupported-initializer-types.cir +++ /dev/null @@ -1,70 +0,0 @@ -// RUN: cir-opt %s --split-input-file --cir-to-llvm -verify-diagnostics | FileCheck %s - -// Vector-of-_BitInt conversion is unsupported; propagate its failure to the -// enclosing operation and diagnose the active initializer's type. - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!union = !cir.union<"U" {data !cir.int<s, 128>, data !vec}> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // The union's integer storage converts, but its active initializer does not. - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.global'}} - cir.global external @global_union = #cir.const_record<{#cir.zero : !vec}> : !union -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!union = !cir.union<"U" {data !cir.int<s, 128>, data !vec}> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - cir.func @constant_union() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.const_record<{#cir.zero : !vec}> : !union - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!union = !cir.union<"U" {data !cir.int<s, 128>, data !vec}> -!outer = !cir.union<"Outer" {data !cir.int<s, 128>, data !union}> -!record = !cir.struct<"Record" {data !outer}> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Propagate adjustment failure through both the enclosing union and struct. - cir.func @nested_union() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.const_record<{#cir.const_record<{#cir.const_record<{#cir.zero : !vec}> : !union}> : !outer}> : !record - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!union = !cir.union<"U" {data !cir.int<s, 128>, data !vec}> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - cir.func @array_union() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.const_array<[#cir.const_record<{#cir.zero : !vec}> : !union]> : !cir.array<!union x 1> - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!union = !cir.union<"U" {data !cir.int<s, 128>, data !vec}> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // An inactive unsupported member does not prevent lowering integer storage. - // CHECK: llvm.mlir.global external @integer_initializer - cir.global external @integer_initializer = #cir.const_record<{#cir.int<0> : !cir.int<s, 128>}> : !union -} diff --git a/clang/test/CIR/Lowering/unsupported-type-conversions.cir b/clang/test/CIR/Lowering/unsupported-type-conversions.cir deleted file mode 100644 index 1a75410dc1a358..00000000000000 --- a/clang/test/CIR/Lowering/unsupported-type-conversions.cir +++ /dev/null @@ -1,223 +0,0 @@ -// RUN: cir-opt %s --split-input-file --cir-to-llvm -verify-diagnostics - -// Vector-of-_BitInt conversion is unsupported; propagate its failure to the -// enclosing operation and diagnose the type that cannot be converted. - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.func'}} - cir.func private @function_result() -> !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 32, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 32, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.func'}} - cir.func private @function_argument(!vec) -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // The initializer requests FuncType conversion before the function lowers. - cir.global external @function_view = #cir.global_view<@callee> : !cir.ptr<!cir.void> - - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.func'}} - cir.func private @callee() -> !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - cir.func @constant_result() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.zero : !vec - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - cir.func @cast_result() { - %0 = cir.const #cir.zero : !cir.vector<4 x !cir.int<s, 7>> - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.cast'}} - %1 = cir.cast bitcast %0 : !cir.vector<4 x !cir.int<s, 7>> -> !vec - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - cir.func @asm_result() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.asm'}} - %0 = cir.asm(x86_att, out = [], in = [], in_out = [], {"" "=r"}) -> !vec - cir.return - } -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Lower the constant before its target to exercise symbol-type failure. - cir.func @constant_global_view() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.global_view<@target, [0 : i32]> : !ptr - cir.return - } - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Lower the constant before its target to exercise symbol-type failure. - cir.func @constant_array_view() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.const_array<[#cir.global_view<@target, [0 : i32]> : !ptr]> : !cir.array<!ptr x 1> - cir.return - } - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Lower the constant before its target to exercise symbol-type failure. - cir.func @constant_record_view() { - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.const'}} - %0 = cir.const #cir.const_record<{#cir.global_view<@target, [0 : i32]> : !ptr}> : !cir.struct<{data !ptr}> - cir.return - } - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Propagate initializer failure before lowering the referenced global. - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.global'}} - cir.global external @global_view = #cir.global_view<@target, [0 : i32]> : !ptr - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Conversion failure rolls back the unresolved block address. Stop before - // attempting to resolve it against a label that has not been lowered. - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.global'}} - cir.global external @block_address_view = #cir.const_array<[#cir.block_addr_info<@f, "L"> : !ptr, #cir.global_view<@target, [0 : i32]> : !ptr]> : !cir.array<!ptr x 2> - - cir.func @f() { - cir.br ^bb1 - ^bb1: - cir.label "L" - cir.return - } - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Propagate initializer failure before lowering the referenced global. - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.global'}} - cir.global external @typeinfo_view = #cir.typeinfo<{#cir.global_view<@target, [0 : i32]> : !ptr}> : !cir.struct<{data !ptr}> - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> -!ptr = !cir.ptr<!cir.void> - -module attributes {cir.triple = "x86_64-unknown-linux-gnu"} { - // Propagate initializer failure before lowering the referenced global. - // expected-error @below {{ClangIR lowering NYI: cannot convert '!cir.vector<4 x !cir.int<s, 7, bitint>>'}} - // expected-error @below {{failed to legalize operation 'cir.global'}} - cir.global external @vtable_view = #cir.vtable<{#cir.const_array<[#cir.global_view<@target, [0 : i32]> : !ptr]> : !cir.array<!ptr x 1>}, address_points = [#cir.address_point<index = 0, offset = 0>]> : !cir.struct<{data !cir.array<!ptr x 1>}> - - cir.global external @target = #cir.zero : !vec -} - -// ----- - -!vec = !cir.vector<4 x !cir.int<s, 7, bitint>> - -module a... [truncated] `````````` </details> https://github.com/llvm/llvm-project/pull/244412 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
