diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 680be736aa647..e1326bba37269 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -2128,6 +2128,13 @@ bool Compiler::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 9b2b20773be58..324b8c741130c 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);