Author: Timm Baeder Date: 2024-10-05T18:04:06+02:00 New Revision: c57418037a002f4c5f19339837cc37e3a8f4ecb8
URL: https://github.com/llvm/llvm-project/commit/c57418037a002f4c5f19339837cc37e3a8f4ecb8 DIFF: https://github.com/llvm/llvm-project/commit/c57418037a002f4c5f19339837cc37e3a8f4ecb8.diff LOG: [clang][bytecode] Handle UETT_OpenMPRequiredSimdAlign (#111259) Added: Modified: clang/lib/AST/ByteCode/Compiler.cpp clang/test/AST/ByteCode/builtins.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 680be736aa6471..e1326bba37269f 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -2128,6 +2128,13 @@ bool Compiler<Emitter>::VisitUnaryExprOrTypeTraitExpr( return this->emitConst(1, E); } + if (Kind == UETT_OpenMPRequiredSimdAlign) { + assert(E->isArgumentType()); + unsigned Bits = ASTCtx.getOpenMPDefaultSimdAlign(E->getArgumentType()); + + return this->emitConst(ASTCtx.toCharUnitsFromBits(Bits).getQuantity(), E); + } + return false; } diff --git a/clang/test/AST/ByteCode/builtins.cpp b/clang/test/AST/ByteCode/builtins.cpp index 9b2b20773be58a..324b8c741130c6 100644 --- a/clang/test/AST/ByteCode/builtins.cpp +++ b/clang/test/AST/ByteCode/builtins.cpp @@ -36,3 +36,5 @@ void test_builtin_os_log(void *buf, int i, const char *data) { constexpr int len = __builtin_os_log_format_buffer_size("%d %{public}s %{private}.16P", i, data, data); static_assert(len > 0, "Expect len > 0"); } + +static_assert(__builtin_omp_required_simd_align(int) != 0); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits