56 changes: 11 additions & 45 deletions clang/lib/AST/StmtOpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,44 +28,15 @@ OpenACCComputeConstruct::CreateEmpty(const ASTContext &C, unsigned NumClauses) {
OpenACCComputeConstruct *OpenACCComputeConstruct::Create(
const ASTContext &C, OpenACCDirectiveKind K, SourceLocation BeginLoc,
SourceLocation DirLoc, SourceLocation EndLoc,
ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock,
ArrayRef<OpenACCLoopConstruct *> AssociatedLoopConstructs) {
ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock) {
void *Mem = C.Allocate(
OpenACCComputeConstruct::totalSizeToAlloc<const OpenACCClause *>(
Clauses.size()));
auto *Inst = new (Mem) OpenACCComputeConstruct(K, BeginLoc, DirLoc, EndLoc,
Clauses, StructuredBlock);

llvm::for_each(AssociatedLoopConstructs, [&](OpenACCLoopConstruct *C) {
C->setParentComputeConstruct(Inst);
});

return Inst;
}

void OpenACCComputeConstruct::findAndSetChildLoops() {
struct LoopConstructFinder : RecursiveASTVisitor<LoopConstructFinder> {
OpenACCComputeConstruct *Construct = nullptr;

LoopConstructFinder(OpenACCComputeConstruct *Construct)
: Construct(Construct) {}

bool TraverseOpenACCComputeConstruct(OpenACCComputeConstruct *C) {
// Stop searching if we find a compute construct.
return true;
}
bool TraverseOpenACCLoopConstruct(OpenACCLoopConstruct *C) {
// Stop searching if we find a loop construct, after taking ownership of
// it.
C->setParentComputeConstruct(Construct);
return true;
}
};

LoopConstructFinder f(this);
f.TraverseStmt(getAssociatedStmt());
}

OpenACCLoopConstruct::OpenACCLoopConstruct(unsigned NumClauses)
: OpenACCAssociatedStmtConstruct(
OpenACCLoopConstructClass, OpenACCDirectiveKind::Loop,
Expand All @@ -79,11 +50,13 @@ OpenACCLoopConstruct::OpenACCLoopConstruct(unsigned NumClauses)
}

OpenACCLoopConstruct::OpenACCLoopConstruct(
SourceLocation Start, SourceLocation DirLoc, SourceLocation End,
OpenACCDirectiveKind ParentKind, SourceLocation Start,
SourceLocation DirLoc, SourceLocation End,
ArrayRef<const OpenACCClause *> Clauses, Stmt *Loop)
: OpenACCAssociatedStmtConstruct(OpenACCLoopConstructClass,
OpenACCDirectiveKind::Loop, Start, DirLoc,
End, Loop) {
End, Loop),
ParentComputeConstructKind(ParentKind) {
// accept 'nullptr' for the loop. This is diagnosed somewhere, but this gives
// us some level of AST fidelity in the error case.
assert((Loop == nullptr || isa<ForStmt, CXXForRangeStmt>(Loop)) &&
Expand All @@ -96,12 +69,6 @@ OpenACCLoopConstruct::OpenACCLoopConstruct(
Clauses.size()));
}

void OpenACCLoopConstruct::setLoop(Stmt *Loop) {
assert((isa<ForStmt, CXXForRangeStmt>(Loop)) &&
"Associated Loop not a for loop?");
setAssociatedStmt(Loop);
}

OpenACCLoopConstruct *OpenACCLoopConstruct::CreateEmpty(const ASTContext &C,
unsigned NumClauses) {
void *Mem =
Expand All @@ -111,15 +78,14 @@ OpenACCLoopConstruct *OpenACCLoopConstruct::CreateEmpty(const ASTContext &C,
return Inst;
}

OpenACCLoopConstruct *
OpenACCLoopConstruct::Create(const ASTContext &C, SourceLocation BeginLoc,
SourceLocation DirLoc, SourceLocation EndLoc,
ArrayRef<const OpenACCClause *> Clauses,
Stmt *Loop) {
OpenACCLoopConstruct *OpenACCLoopConstruct::Create(
const ASTContext &C, OpenACCDirectiveKind ParentKind,
SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc,
ArrayRef<const OpenACCClause *> Clauses, Stmt *Loop) {
void *Mem =
C.Allocate(OpenACCLoopConstruct::totalSizeToAlloc<const OpenACCClause *>(
Clauses.size()));
auto *Inst =
new (Mem) OpenACCLoopConstruct(BeginLoc, DirLoc, EndLoc, Clauses, Loop);
auto *Inst = new (Mem)
OpenACCLoopConstruct(ParentKind, BeginLoc, DirLoc, EndLoc, Clauses, Loop);
return Inst;
}
2 changes: 1 addition & 1 deletion clang/lib/AST/TextNodeDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2928,7 +2928,7 @@ void TextNodeDumper::VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *S) {
if (S->isOrphanedLoopConstruct())
OS << " <orphan>";
else
OS << " parent: " << S->getParentComputeConstruct();
OS << " parent: " << S->getParentComputeConstructKind();
}

void TextNodeDumper::VisitEmbedExpr(const EmbedExpr *S) {
Expand Down
28 changes: 10 additions & 18 deletions clang/lib/Basic/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "clang/Basic/TargetInfo.h"

#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSwitch.h"

using namespace clang;

Expand Down Expand Up @@ -155,26 +156,17 @@ std::string AttributeCommonInfo::getNormalizedFullName() const {
normalizeName(getAttrName(), getScopeName(), getSyntax()));
}

// Sorted list of attribute scope names
static constexpr std::pair<StringRef, AttributeCommonInfo::Scope> ScopeList[] =
{{"", AttributeCommonInfo::Scope::NONE},
{"clang", AttributeCommonInfo::Scope::CLANG},
{"gnu", AttributeCommonInfo::Scope::GNU},
{"gsl", AttributeCommonInfo::Scope::GSL},
{"hlsl", AttributeCommonInfo::Scope::HLSL},
{"msvc", AttributeCommonInfo::Scope::MSVC},
{"omp", AttributeCommonInfo::Scope::OMP},
{"riscv", AttributeCommonInfo::Scope::RISCV}};

AttributeCommonInfo::Scope
getScopeFromNormalizedScopeName(StringRef ScopeName) {
auto It = std::lower_bound(
std::begin(ScopeList), std::end(ScopeList), ScopeName,
[](const std::pair<StringRef, AttributeCommonInfo::Scope> &Element,
StringRef Value) { return Element.first < Value; });
assert(It != std::end(ScopeList) && It->first == ScopeName);

return It->second;
return llvm::StringSwitch<AttributeCommonInfo::Scope>(ScopeName)
.Case("", AttributeCommonInfo::Scope::NONE)
.Case("clang", AttributeCommonInfo::Scope::CLANG)
.Case("gnu", AttributeCommonInfo::Scope::GNU)
.Case("gsl", AttributeCommonInfo::Scope::GSL)
.Case("hlsl", AttributeCommonInfo::Scope::HLSL)
.Case("msvc", AttributeCommonInfo::Scope::MSVC)
.Case("omp", AttributeCommonInfo::Scope::OMP)
.Case("riscv", AttributeCommonInfo::Scope::RISCV);
}

unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {
Expand Down
12 changes: 7 additions & 5 deletions clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasSVE2p1)
Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");

if (HasSVE2 && HasSVEAES)
if (HasSVE2 && HasSVE2AES)
Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");

if (HasSVE2 && HasSVE2BitPerm)
Expand Down Expand Up @@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
.Case("f32mm", FPU & SveMode && HasMatmulFP32)
.Case("f64mm", FPU & SveMode && HasMatmulFP64)
.Case("sve2", FPU & SveMode && HasSVE2)
.Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
.Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
.Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
.Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
.Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
Expand Down Expand Up @@ -861,10 +861,12 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasSVE2 = true;
HasSVE2p1 = true;
}
if (Feature == "+sve-aes") {
if (Feature == "+sve2-aes") {
FPU |= NeonMode;
HasAES = true;
HasSVEAES = true;
FPU |= SveMode;
HasFullFP16 = true;
HasSVE2 = true;
HasSVE2AES = true;
}
if (Feature == "+sve2-sha3") {
FPU |= NeonMode;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
bool HasBFloat16 = false;
bool HasSVE2 = false;
bool HasSVE2p1 = false;
bool HasSVEAES = false;
bool HasSVE2AES = false;
bool HasSVE2SHA3 = false;
bool HasSVE2SM4 = false;
bool HasSVEB16B16 = false;
Expand Down
9 changes: 3 additions & 6 deletions clang/lib/Basic/Targets/AMDGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,9 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
if (hasFastFMA())
Builder.defineMacro("FP_FAST_FMA");

Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize),
"compile-time-constant access to the wavefront size will "
"be removed in a future release");
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE", Twine(WavefrontSize),
"compile-time-constant access to the wavefront size will "
"be removed in a future release");
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE__", Twine(WavefrontSize));
// ToDo: deprecate this macro for naming consistency.
Builder.defineMacro("__AMDGCN_WAVEFRONT_SIZE", Twine(WavefrontSize));
Builder.defineMacro("__AMDGCN_CUMODE__", Twine(CUMode));
}

Expand Down
6 changes: 4 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include "mlir/IR/Location.h"
#include "mlir/IR/MLIRContext.h"

using namespace cir;
using namespace clang;
using namespace clang::CIRGen;

CIRGenModule::CIRGenModule(mlir::MLIRContext &context,
clang::ASTContext &astctx,
const clang::CodeGenOptions &cgo,
Expand Down Expand Up @@ -75,7 +77,7 @@ void CIRGenModule::buildGlobal(clang::GlobalDecl gd) {
void CIRGenModule::buildGlobalFunctionDefinition(clang::GlobalDecl gd,
mlir::Operation *op) {
auto const *funcDecl = cast<FunctionDecl>(gd.getDecl());
auto funcOp = builder.create<mlir::cir::FuncOp>(
auto funcOp = builder.create<cir::FuncOp>(
getLoc(funcDecl->getSourceRange()), funcDecl->getIdentifier()->getName());
theModule.push_back(funcOp);
}
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ class LangOptions;
class SourceLocation;
class SourceRange;
class TargetInfo;
} // namespace clang

using namespace clang;
namespace cir {
namespace CIRGen {

/// This class organizes the cross-function state that is used while generating
/// CIR code.
Expand Down Expand Up @@ -91,6 +89,8 @@ class CIRGenModule : public CIRGenTypeCache {
DiagnosticBuilder errorNYI(SourceRange, llvm::StringRef);
DiagnosticBuilder errorNYI(SourceRange, llvm::StringRef, llvm::StringRef);
};
} // namespace cir
} // namespace CIRGen

} // namespace clang

#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENMODULE_H
4 changes: 2 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenTypeCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
#define LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H

namespace cir {
namespace clang::CIRGen {

/// This structure provides a set of types that are commonly used
/// during IR emission. It's initialized once in CodeGenModule's
Expand All @@ -22,6 +22,6 @@ struct CIRGenTypeCache {
CIRGenTypeCache() = default;
};

} // namespace cir
} // namespace clang::CIRGen

#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTYPECACHE_H
6 changes: 3 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void CIRGenerator::Initialize(ASTContext &astCtx) {
this->astCtx = &astCtx;

mlirCtx = std::make_unique<mlir::MLIRContext>();
mlirCtx->loadDialect<mlir::cir::CIRDialect>();
cgm = std::make_unique<CIRGenModule>(*mlirCtx.get(), astCtx, codeGenOpts,
diags);
mlirCtx->loadDialect<cir::CIRDialect>();
cgm = std::make_unique<clang::CIRGen::CIRGenModule>(*mlirCtx.get(), astCtx,
codeGenOpts, diags);
}

mlir::ModuleOp CIRGenerator::getModule() const { return cgm->getModule(); }
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "clang/CIR/Dialect/IR/CIRDialect.h"

using namespace mlir;
using namespace mlir::cir;
using namespace cir;

//===----------------------------------------------------------------------===//
// General CIR parsing / printing
Expand Down
10 changes: 5 additions & 5 deletions clang/lib/CIR/Dialect/IR/CIRDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#include "clang/CIR/Dialect/IR/CIROpsDialect.cpp.inc"

using namespace mlir;
using namespace mlir::cir;
using namespace cir;

//===----------------------------------------------------------------------===//
// CIR Dialect
//===----------------------------------------------------------------------===//

void mlir::cir::CIRDialect::initialize() {
void cir::CIRDialect::initialize() {
registerTypes();
registerAttributes();
addOperations<
Expand All @@ -36,8 +36,8 @@ void mlir::cir::CIRDialect::initialize() {
// FuncOp
//===----------------------------------------------------------------------===//

void mlir::cir::FuncOp::build(OpBuilder &builder, OperationState &result,
StringRef name) {
void cir::FuncOp::build(OpBuilder &builder, OperationState &result,
StringRef name) {
result.addAttribute(SymbolTable::getSymbolAttrName(),
builder.getStringAttr(name));
}
Expand All @@ -56,7 +56,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
p.printSymbolName(getSymName());
}

mlir::LogicalResult mlir::cir::FuncOp::verify() { return success(); }
mlir::LogicalResult cir::FuncOp::verify() { return success(); }

//===----------------------------------------------------------------------===//
// TableGen'd op method definitions
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CIR/Dialect/IR/CIRTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "clang/CIR/Dialect/IR/CIRDialect.h"

using namespace mlir;
using namespace mlir::cir;
using namespace cir;

//===----------------------------------------------------------------------===//
// General CIR parsing / printing
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CreateFrontendBaseAction(CompilerInstance &CI) {
case EmitBC: return std::make_unique<EmitBCAction>();
case EmitCIR:
#if CLANG_ENABLE_CIR
return std::make_unique<::cir::EmitCIRAction>();
return std::make_unique<cir::EmitCIRAction>();
#else
llvm_unreachable("CIR suppport not built into clang");
#endif
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Headers/emmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4626,7 +4626,8 @@ _mm_movepi64_pi64(__m128i __a) {
/// A 64-bit value.
/// \returns A 128-bit integer vector. The lower 64 bits contain the value from
/// the operand. The upper 64 bits are assigned zeros.
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movpi64_epi64(__m64 __a) {
static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
_mm_movpi64_epi64(__m64 __a) {
return __builtin_shufflevector((__v1di)__a, _mm_setzero_si64(), 0, 1);
}

Expand Down
78 changes: 37 additions & 41 deletions clang/lib/Headers/mmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ typedef char __v16qi __attribute__((__vector_size__(16)));
__min_vector_width__(128)))
#endif

#if defined(__cplusplus) && (__cplusplus >= 201103L)
#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2 constexpr
#else
#define __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR __DEFAULT_FN_ATTRS_SSE2
#endif

#define __trunc64(x) \
(__m64) __builtin_shufflevector((__v2di)(x), __extension__(__v2di){}, 0)
#define __anyext128(x) \
Expand Down Expand Up @@ -1332,10 +1338,9 @@ _mm_cmpgt_pi32(__m64 __m1, __m64 __m2)
/// This intrinsic corresponds to the <c> PXOR </c> instruction.
///
/// \returns An initialized 64-bit integer vector with all elements set to zero.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_setzero_si64(void)
{
return __extension__ (__m64){ 0LL };
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_setzero_si64(void) {
return __extension__(__m64){0LL};
}

/// Constructs a 64-bit integer vector initialized with the specified
Expand All @@ -1353,10 +1358,9 @@ _mm_setzero_si64(void)
/// A 32-bit integer value used to initialize the lower 32 bits of the
/// result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_set_pi32(int __i1, int __i0)
{
return __extension__ (__m64)(__v2si){__i0, __i1};
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set_pi32(int __i1, int __i0) {
return __extension__(__m64)(__v2si){__i0, __i1};
}

/// Constructs a 64-bit integer vector initialized with the specified
Expand All @@ -1376,10 +1380,9 @@ _mm_set_pi32(int __i1, int __i0)
/// \param __s0
/// A 16-bit integer value used to initialize bits [15:0] of the result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_set_pi16(short __s3, short __s2, short __s1, short __s0)
{
return __extension__ (__m64)(__v4hi){__s0, __s1, __s2, __s3};
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set_pi16(short __s3, short __s2, short __s1, short __s0) {
return __extension__(__m64)(__v4hi){__s0, __s1, __s2, __s3};
}

/// Constructs a 64-bit integer vector initialized with the specified
Expand Down Expand Up @@ -1407,12 +1410,11 @@ _mm_set_pi16(short __s3, short __s2, short __s1, short __s0)
/// \param __b0
/// An 8-bit integer value used to initialize bits [7:0] of the result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
char __b1, char __b0)
{
return __extension__ (__m64)(__v8qi){__b0, __b1, __b2, __b3,
__b4, __b5, __b6, __b7};
char __b1, char __b0) {
return __extension__(__m64)(__v8qi){__b0, __b1, __b2, __b3,
__b4, __b5, __b6, __b7};
}

/// Constructs a 64-bit integer vector of [2 x i32], with each of the
Expand All @@ -1428,10 +1430,9 @@ _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
/// A 32-bit integer value used to initialize each vector element of the
/// result.
/// \returns An initialized 64-bit integer vector of [2 x i32].
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_set1_pi32(int __i)
{
return _mm_set_pi32(__i, __i);
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set1_pi32(int __i) {
return _mm_set_pi32(__i, __i);
}

/// Constructs a 64-bit integer vector of [4 x i16], with each of the
Expand All @@ -1447,10 +1448,9 @@ _mm_set1_pi32(int __i)
/// A 16-bit integer value used to initialize each vector element of the
/// result.
/// \returns An initialized 64-bit integer vector of [4 x i16].
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_set1_pi16(short __w)
{
return _mm_set_pi16(__w, __w, __w, __w);
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set1_pi16(short __w) {
return _mm_set_pi16(__w, __w, __w, __w);
}

/// Constructs a 64-bit integer vector of [8 x i8], with each of the
Expand All @@ -1465,10 +1465,9 @@ _mm_set1_pi16(short __w)
/// An 8-bit integer value used to initialize each vector element of the
/// result.
/// \returns An initialized 64-bit integer vector of [8 x i8].
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_set1_pi8(char __b)
{
return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_set1_pi8(char __b) {
return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b);
}

/// Constructs a 64-bit integer vector, initialized in reverse order with
Expand All @@ -1486,10 +1485,9 @@ _mm_set1_pi8(char __b)
/// A 32-bit integer value used to initialize the upper 32 bits of the
/// result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_setr_pi32(int __i0, int __i1)
{
return _mm_set_pi32(__i1, __i0);
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_setr_pi32(int __i0, int __i1) {
return _mm_set_pi32(__i1, __i0);
}

/// Constructs a 64-bit integer vector, initialized in reverse order with
Expand All @@ -1509,10 +1507,9 @@ _mm_setr_pi32(int __i0, int __i1)
/// \param __w3
/// A 16-bit integer value used to initialize bits [63:48] of the result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3)
{
return _mm_set_pi16(__w3, __w2, __w1, __w0);
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) {
return _mm_set_pi16(__w3, __w2, __w1, __w0);
}

/// Constructs a 64-bit integer vector, initialized in reverse order with
Expand Down Expand Up @@ -1540,11 +1537,10 @@ _mm_setr_pi16(short __w0, short __w1, short __w2, short __w3)
/// \param __b7
/// An 8-bit integer value used to initialize bits [63:56] of the result.
/// \returns An initialized 64-bit integer vector.
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2
static __inline__ __m64 __DEFAULT_FN_ATTRS_SSE2_CONSTEXPR
_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
char __b6, char __b7)
{
return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
char __b6, char __b7) {
return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
}

#undef __anyext128
Expand Down
11 changes: 6 additions & 5 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19365,11 +19365,12 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
}

// Structs without named members are extension in C (C99 6.7.2.1p7),
// but are accepted by GCC.
if (NonBitFields == 0 && !getLangOpts().CPlusPlus) {
Diag(RecLoc, IsEmpty ? diag::ext_empty_struct_union :
diag::ext_no_named_members_in_struct_union)
<< Record->isUnion();
// but are accepted by GCC. In C2y, this became implementation-defined
// (C2y 6.7.3.2p10).
if (NonBitFields == 0 && !getLangOpts().CPlusPlus && !getLangOpts().C2y) {
Diag(RecLoc, IsEmpty ? diag::ext_empty_struct_union
: diag::ext_no_named_members_in_struct_union)
<< Record->isUnion();
}
}
} else {
Expand Down
29 changes: 7 additions & 22 deletions clang/lib/Sema/SemaOpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,6 @@ SemaOpenACC::AssociatedStmtRAII::AssociatedStmtRAII(
CollectActiveReductionClauses(S.ActiveReductionClauses, Clauses);
SemaRef.ActiveComputeConstructInfo.Kind = DirKind;
SemaRef.ActiveComputeConstructInfo.Clauses = Clauses;
SemaRef.ParentlessLoopConstructs.swap(ParentlessLoopConstructs);

// OpenACC 3.3 2.9.2: When the parent compute construct is a kernels
// construct, the gang clause behaves as follows. ... The region of a loop
Expand Down Expand Up @@ -1668,9 +1667,8 @@ SemaOpenACC::AssociatedStmtRAII::~AssociatedStmtRAII() {
if (DirKind == OpenACCDirectiveKind::Parallel ||
DirKind == OpenACCDirectiveKind::Serial ||
DirKind == OpenACCDirectiveKind::Kernels) {
assert(SemaRef.ParentlessLoopConstructs.empty() &&
"Didn't consume loop construct list?");
SemaRef.ParentlessLoopConstructs.swap(ParentlessLoopConstructs);
// Nothing really to do here, the restorations above should be enough for
// now.
} else if (DirKind == OpenACCDirectiveKind::Loop) {
// Nothing really to do here, the LoopInConstruct should handle restorations
// correctly.
Expand Down Expand Up @@ -3171,27 +3169,14 @@ StmtResult SemaOpenACC::ActOnEndStmtDirective(OpenACCDirectiveKind K,
case OpenACCDirectiveKind::Parallel:
case OpenACCDirectiveKind::Serial:
case OpenACCDirectiveKind::Kernels: {
auto *ComputeConstruct = OpenACCComputeConstruct::Create(
return OpenACCComputeConstruct::Create(
getASTContext(), K, StartLoc, DirLoc, EndLoc, Clauses,
AssocStmt.isUsable() ? AssocStmt.get() : nullptr,
ParentlessLoopConstructs);

ParentlessLoopConstructs.clear();

return ComputeConstruct;
AssocStmt.isUsable() ? AssocStmt.get() : nullptr);
}
case OpenACCDirectiveKind::Loop: {
auto *LoopConstruct = OpenACCLoopConstruct::Create(
getASTContext(), StartLoc, DirLoc, EndLoc, Clauses,
AssocStmt.isUsable() ? AssocStmt.get() : nullptr);

// If we are in the scope of a compute construct, add this to the list of
// loop constructs that need assigning to the next closing compute
// construct.
if (isInComputeConstruct())
ParentlessLoopConstructs.push_back(LoopConstruct);

return LoopConstruct;
return OpenACCLoopConstruct::Create(
getASTContext(), ActiveComputeConstructInfo.Kind, StartLoc, DirLoc,
EndLoc, Clauses, AssocStmt.isUsable() ? AssocStmt.get() : nullptr);
}
}
llvm_unreachable("Unhandled case in directive handling?");
Expand Down
9 changes: 6 additions & 3 deletions clang/lib/Sema/SemaType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,16 +1500,19 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) {
// C99 6.7.3p8:
// If the specification of a function type includes any type qualifiers,
// the behavior is undefined.
// C2y changed this behavior to be implementation-defined. Clang defines
// the behavior in all cases to ignore the qualifier, as in C++.
// C++11 [dcl.fct]p7:
// The effect of a cv-qualifier-seq in a function declarator is not the
// same as adding cv-qualification on top of the function type. In the
// latter case, the cv-qualifiers are ignored.
if (Result->isFunctionType()) {
unsigned DiagId = diag::warn_typecheck_function_qualifiers_ignored;
if (!S.getLangOpts().CPlusPlus && !S.getLangOpts().C2y)
DiagId = diag::ext_typecheck_function_qualifiers_unspecified;
diagnoseAndRemoveTypeQualifiers(
S, DS, TypeQuals, Result, DeclSpec::TQ_const | DeclSpec::TQ_volatile,
S.getLangOpts().CPlusPlus
? diag::warn_typecheck_function_qualifiers_ignored
: diag::warn_typecheck_function_qualifiers_unspecified);
DiagId);
// No diagnostic for 'restrict' or '_Atomic' applied to a
// function type; we'll diagnose those later, in BuildQualifiedType.
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Serialization/ASTReaderStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2836,12 +2836,12 @@ void ASTStmtReader::VisitOpenACCAssociatedStmtConstruct(
void ASTStmtReader::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
VisitStmt(S);
VisitOpenACCAssociatedStmtConstruct(S);
S->findAndSetChildLoops();
}

void ASTStmtReader::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
VisitStmt(S);
VisitOpenACCAssociatedStmtConstruct(S);
S->ParentComputeConstructKind = Record.readEnum<OpenACCDirectiveKind>();
}

//===----------------------------------------------------------------------===//
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Serialization/ASTWriterStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2915,6 +2915,7 @@ void ASTStmtWriter::VisitOpenACCComputeConstruct(OpenACCComputeConstruct *S) {
void ASTStmtWriter::VisitOpenACCLoopConstruct(OpenACCLoopConstruct *S) {
VisitStmt(S);
VisitOpenACCAssociatedStmtConstruct(S);
Record.writeEnum(S->getParentComputeConstructKind());
Code = serialization::STMT_OPENACC_LOOP_CONSTRUCT;
}

Expand Down
18 changes: 18 additions & 0 deletions clang/test/C/C2y/n3341.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic %s
// RUN: %clang_cc1 -verify=gnu -Wall -pedantic %s

/* WG14 N3341: Yes
* Slay Some Earthly Demons III
*
* Empty structure and union objects are now implementation-defined.
*/

// expected-no-diagnostics

struct R {}; // gnu-warning {{empty struct is a GNU extension}}
#if __STDC_VERSION__ >= 201112L
struct S { struct { }; }; // gnu-warning {{empty struct is a GNU extension}}
#endif
struct T { int : 0; }; // gnu-warning {{struct without named members is a GNU extension}}
union U {}; // gnu-warning {{empty union is a GNU extension}}

31 changes: 31 additions & 0 deletions clang/test/C/C2y/n3342.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// RUN: %clang_cc1 -verify=expected,both -std=c2y -Wall -pedantic %s
// RUN: %clang_cc1 -verify=clang,both -Wall -pedantic %s

/* WG14 N3342: Yes
* Slay Some Earthly Demons IV
*
* Qualified function types are now implementation-defined instead of
* undefined. Clang strips the qualifiers.
*/

typedef int f(void);

const f one; /* expected-warning {{'const' qualifier on function type 'f' (aka 'int (void)') has no effect}}
clang-warning {{'const' qualifier on function type 'f' (aka 'int (void)') has no effect and is a Clang extension}}
*/
volatile f two; /* expected-warning {{'volatile' qualifier on function type 'f' (aka 'int (void)') has no effect}}
clang-warning {{'volatile' qualifier on function type 'f' (aka 'int (void)') has no effect and is a Clang extension}}
*/

const volatile f three; /* expected-warning {{'const' qualifier on function type 'f' (aka 'int (void)') has no effect}}
clang-warning {{'const' qualifier on function type 'f' (aka 'int (void)') has no effect and is a Clang extension}}
expected-warning {{'volatile' qualifier on function type 'f' (aka 'int (void)') has no effect}}
clang-warning {{'volatile' qualifier on function type 'f' (aka 'int (void)') has no effect and is a Clang extension}}
*/

#if __STDC_VERSION__ >= 201112L
// Atomic types have an explicit constraint making it ill-formed.
_Atomic f four; // both-error {{_Atomic cannot be applied to function type 'f' (aka 'int (void)')}}
#endif

// There's no point to testing 'restrict' because that requires a pointer type.
74 changes: 74 additions & 0 deletions clang/test/C/C2y/n3346.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
// RUN: %clang_cc1 -std=c99 -verify=expected,ped -Wall -pedantic -ffreestanding %s

/* WG14 N3346: Yes
* Slay Some Earthly Demons VIII
*
* Updates some undefined behavior during initialization to instead be a
* constraint violation.
*/

// The initializer for a scalar shall be a single expression, optionally
// enclosed in braces, or it shall be an empty initializer.
int i = 12, j = {12}, k = {}; // ped-warning {{use of an empty initializer is a C23 extension}}

struct S {
int i;
float f;
int : 0;
char c;
};

void test1(void) {
// The initializer for an object that has structure or union type shall be
// either a single expression that has compatible type or a brace-enclosed
// list of initializers for the elements or named members.
struct S s1 = { 1, 1.2f, 'a' };
struct S s2 = s1;

// Despite being structurally identical to S, T is not compatible with S.
struct T { int i; float f; int : 0; char c; } t;
struct S s3 = t; // expected-error {{initializing 'struct S' with an expression of incompatible type 'struct T'}}
}

void test2(void) {
typedef __WCHAR_TYPE__ wchar_t;

// The initializer for an array shall be either a string literal, optionally
// enclosed in braces, or a brace-enclosed list of initializers for the
// elements. An array initialized by character string literal or UTF-8 string
// literal shall have a character type as element type. An array initialized
// with a wide string literal shall have element type compatible with a
// qualified or unqualified wchar_t, char16_t, or char32_t, and the string
// literal shall have the corresponding encoding prefix (L, u, or U,
// respectively).
char str1[] = "string literal";
char str2[] = { "string literal" };

float str5[] = "this doesn't work"; // expected-error {{array initializer must be an initializer list}}
float str6[] = { "this also doesn't work" }; // expected-error {{initializing 'float' with an expression of incompatible type 'char[23]'}}

wchar_t str7[] = L"string literal";
wchar_t str8[] = { L"string literal" };

#if __STDC_VERSION__ >= 201112L
typedef __CHAR16_TYPE__ char16_t;
typedef __CHAR32_TYPE__ char32_t;

char str3[] = u8"string literal";
char str4[] = { u8"string literal" };

char16_t str9[] = u"string literal";
char16_t str10[] = { u"string literal" };
char32_t str11[] = U"string literal";
char32_t str12[] = { U"string literal" };

char16_t str15[] = "nope"; // expected-error {{initializing wide char array with non-wide string literal}}
char16_t str16[] = { "nope" }; // expected-error-re {{incompatible pointer to integer conversion initializing 'char16_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
char32_t str17[] = "nope"; // expected-error {{initializing wide char array with non-wide string literal}}
char32_t str18[] = { "nope" }; // expected-error-re {{incompatible pointer to integer conversion initializing 'char32_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
#endif

wchar_t str13[] = "nope"; // expected-error {{initializing wide char array with non-wide string literal}}
wchar_t str14[] = { "nope" }; // expected-error-re {{incompatible pointer to integer conversion initializing 'wchar_t' (aka '{{.*}}') with an expression of type 'char[5]'}}
}
19 changes: 19 additions & 0 deletions clang/test/CodeGen/X86/builtin_test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ constexpr bool match_m64(__m64 _v, unsigned long long a) {
return v[0] == a;
}

constexpr bool match_v1di(__m64 v, long long a) {
return v[0] == a;
}

constexpr bool match_v2si(__m64 _v, int a, int b) {
__v2si v = (__v2si)_v;
return v[0] == a && v[1] == b;
}

constexpr bool match_v4hi(__m64 _v, short a, short b, short c, short d) {
__v4hi v = (__v4hi)_v;
return v[0] == a && v[1] == b && v[2] == c && v[3] == d;
}

constexpr bool match_v8qi(__m64 _v, char a, char b, char c, char d, char e, char f, char g, char h) {
__v8qi v = (__v8qi)_v;
return v[0] == a && v[1] == b && v[2] == c && v[3] == d && v[4] == e && v[5] == f && v[6] == g && v[7] == h;
}

constexpr bool match_m128(__m128 v, float a, float b, float c, float d) {
return v[0] == a && v[1] == b && v[2] == c && v[3] == d;
}
Expand Down
17 changes: 17 additions & 0 deletions clang/test/CodeGen/X86/mmx-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


#include <immintrin.h>
#include "builtin_test_helpers.h"

__m64 test_mm_abs_pi8(__m64 a) {
// CHECK-LABEL: test_mm_abs_pi8
Expand Down Expand Up @@ -409,6 +410,7 @@ __m64 test_mm_set_pi8(char a, char b, char c, char d, char e, char f, char g, ch
// CHECK: insertelement <8 x i8>
return _mm_set_pi8(a, b, c, d, e, f, g, h);
}
TEST_CONSTEXPR(match_v8qi(_mm_set_pi8(0, -1, 2, -3, 4, -5, 6, -7), -7, 6, -5, 4, -3, 2, -1, 0));

__m64 test_mm_set_pi16(short a, short b, short c, short d) {
// CHECK-LABEL: test_mm_set_pi16
Expand All @@ -418,13 +420,15 @@ __m64 test_mm_set_pi16(short a, short b, short c, short d) {
// CHECK: insertelement <4 x i16>
return _mm_set_pi16(a, b, c, d);
}
TEST_CONSTEXPR(match_v4hi(_mm_set_pi16(101, 102, -103, -104), -104, -103, 102, 101));

__m64 test_mm_set_pi32(int a, int b) {
// CHECK-LABEL: test_mm_set_pi32
// CHECK: insertelement <2 x i32>
// CHECK: insertelement <2 x i32>
return _mm_set_pi32(a, b);
}
TEST_CONSTEXPR(match_v2si(_mm_set_pi32(5000, -1500), -1500, 5000));

__m64 test_mm_setr_pi8(char a, char b, char c, char d, char e, char f, char g, char h) {
// CHECK-LABEL: test_mm_setr_pi8
Expand All @@ -438,6 +442,7 @@ __m64 test_mm_setr_pi8(char a, char b, char c, char d, char e, char f, char g, c
// CHECK: insertelement <8 x i8>
return _mm_setr_pi8(a, b, c, d, e, f, g, h);
}
TEST_CONSTEXPR(match_v8qi(_mm_setr_pi8(0, -1, 2, -3, 4, -5, 6, -7), 0, -1, 2, -3, 4, -5, 6, -7));

__m64 test_mm_setr_pi16(short a, short b, short c, short d) {
// CHECK-LABEL: test_mm_setr_pi16
Expand All @@ -447,13 +452,22 @@ __m64 test_mm_setr_pi16(short a, short b, short c, short d) {
// CHECK: insertelement <4 x i16>
return _mm_setr_pi16(a, b, c, d);
}
TEST_CONSTEXPR(match_v4hi(_mm_setr_pi16(101, 102, -103, -104), 101, 102, -103, -104));

__m64 test_mm_setr_pi32(int a, int b) {
// CHECK-LABEL: test_mm_setr_pi32
// CHECK: insertelement <2 x i32>
// CHECK: insertelement <2 x i32>
return _mm_setr_pi32(a, b);
}
TEST_CONSTEXPR(match_v2si(_mm_setr_pi32(5000, -1500), 5000, -1500));

__m64 test_mm_setzero_si64() {
// CHECK-LABEL: test_mm_setzero_si64
// CHECK: zeroinitializer
return _mm_setzero_si64();
}
TEST_CONSTEXPR(match_m64(_mm_setzero_si64(), 0ULL));

__m64 test_mm_set1_pi8(char a) {
// CHECK-LABEL: test_mm_set1_pi8
Expand All @@ -467,6 +481,7 @@ __m64 test_mm_set1_pi8(char a) {
// CHECK: insertelement <8 x i8>
return _mm_set1_pi8(a);
}
TEST_CONSTEXPR(match_v8qi(_mm_set1_pi8(99), 99, 99, 99, 99, 99, 99, 99, 99));

__m64 test_mm_set1_pi16(short a) {
// CHECK-LABEL: test_mm_set1_pi16
Expand All @@ -476,13 +491,15 @@ __m64 test_mm_set1_pi16(short a) {
// CHECK: insertelement <4 x i16>
return _mm_set1_pi16(a);
}
TEST_CONSTEXPR(match_v4hi(_mm_set1_pi16(-128), -128, -128, -128, -128));

__m64 test_mm_set1_pi32(int a) {
// CHECK-LABEL: test_mm_set1_pi32
// CHECK: insertelement <2 x i32>
// CHECK: insertelement <2 x i32>
return _mm_set1_pi32(a);
}
TEST_CONSTEXPR(match_v2si(_mm_set1_pi32(55), 55, 55));

__m64 test_mm_shuffle_pi8(__m64 a, __m64 b) {
// CHECK-LABEL: test_mm_shuffle_pi8
Expand Down
7 changes: 3 additions & 4 deletions clang/test/CodeGen/X86/sse2-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,20 +867,19 @@ __m128d test_mm_min_sd(__m128d A, __m128d B) {
return _mm_min_sd(A, B);
}

__m64 test_mm_movepi64_pi64(__m128i A)
{
__m64 test_mm_movepi64_pi64(__m128i A) {
// CHECK-LABEL: test_mm_movepi64_pi64
// CHECK: [[EXT:%.*]] = extractelement <2 x i64> %1, i32 0
return _mm_movepi64_pi64(A);
}
TEST_CONSTEXPR(match_m64(_mm_movepi64_pi64((__m128i){8, -8}), 8ULL));

__m128i test_mm_movpi64_epi64(__m64 A)
{
__m128i test_mm_movpi64_epi64(__m64 A) {
// CHECK-LABEL: test_mm_movpi64_epi64
// CHECK: shufflevector <1 x i64> %{{.*}}, <1 x i64> %{{.*}}, <2 x i32> <i32 0, i32 1>
return _mm_movpi64_epi64(A);
}
TEST_CONSTEXPR(match_m128i(_mm_movpi64_epi64((__m64){5LL}), 5ULL, 0ULL));

__m128i test_mm_move_epi64(__m128i A) {
// CHECK-LABEL: test_mm_move_epi64
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/aarch64-fmv-dependencies.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int caller() {
// CHECK: attributes #[[ssbs]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+ssbs,+v8a"
// CHECK: attributes #[[sve]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a"
// CHECK: attributes #[[sve2]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+v8a"
// CHECK: attributes #[[sve2_aes]] = { {{.*}} "target-features"="+aes,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve-aes,+sve2,+v8a"
// CHECK: attributes #[[sve2_aes]] = { {{.*}} "target-features"="+aes,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-aes,+v8a"
// CHECK: attributes #[[sve2_bitperm]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-bitperm,+v8a"
// CHECK: attributes #[[sve2_sha3]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-sha3,+v8a"
// CHECK: attributes #[[sve2_sm4]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-sm4,+v8a"
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

// REQUIRES: aarch64-registered-target

Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

// REQUIRES: aarch64-registered-target

Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

// REQUIRES: aarch64-registered-target

Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

// REQUIRES: aarch64-registered-target

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// REQUIRES: aarch64-registered-target

// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

#include <arm_sve.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// REQUIRES: aarch64-registered-target

// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve2-aes -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

#include <arm_sve.h>

Expand Down
9 changes: 3 additions & 6 deletions clang/test/Driver/aarch64-implied-sve-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// SVE2-BITPERM-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "-sve2-bitperm"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-aes+nosve2-aes %s -### 2>&1 | FileCheck %s --check-prefix=SVE2-AES-REVERT
// SVE2-AES-REVERT: "-target-feature" "+sve" "-target-feature" "+sve-aes" "-target-feature" "+sve2" "-target-feature" "-sve2-aes"
// SVE2-AES-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "-sve2-aes"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-sha3+nosve2-sha3 %s -### 2>&1 | FileCheck %s --check-prefix=SVE2-SHA3-REVERT
// SVE2-SHA3-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "-sve2-sha3"
Expand All @@ -47,11 +47,8 @@
// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-sha3 %s -### 2>&1 | FileCheck %s --check-prefix=SVE2-SHA3
// SVE2-SHA3: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "+sve2-sha3"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve-aes %s -### 2>&1 | FileCheck %s --check-prefix=SVE-AES
// SVE-AES: "-target-feature" "+aes"{{.*}} "-target-feature" "+sve-aes"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-aes %s -### 2>&1 | FileCheck %s --check-prefix=SVE2-AES
// SVE2-AES: "-target-feature" "+sve" "-target-feature" "+sve-aes" "-target-feature" "+sve2" "-target-feature" "+sve2-aes"
// SVE2-AES: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "+sve2-aes"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-sm4 %s -### 2>&1 | FileCheck %s --check-prefix=SVE2-SM4
// SVE2-SM4: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "+sve2-sm4"
Expand All @@ -69,7 +66,7 @@
// SVE-SUBFEATURE-CONFLICT-NOT: "-target-feature" "+sve"

// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+nosve+sve2-aes %s -### 2>&1 | FileCheck %s --check-prefix=SVE-SUBFEATURE-CONFLICT-REV
// SVE-SUBFEATURE-CONFLICT-REV: "-target-feature" "+sve" "-target-feature" "+sve-aes" "-target-feature" "+sve2" "-target-feature" "+sve2-aes"
// SVE-SUBFEATURE-CONFLICT-REV: "-target-feature" "+sve" "-target-feature" "+sve2" "-target-feature" "+sve2-aes"

// RUN: %clang --target=aarch64-linux-gnu -mcpu=neoverse-n2+nosve2 %s -### 2>&1 | FileCheck %s --check-prefix=SVE-MCPU-FEATURES
// SVE-MCPU-FEATURES-NOT: "-target-feature" "+sve2-bitperm"
Expand Down
111 changes: 0 additions & 111 deletions clang/test/Driver/hip-wavefront-size-deprecation-diagnostics.hip

This file was deleted.

7 changes: 3 additions & 4 deletions clang/test/Driver/print-supported-extensions-aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@
// CHECK-NEXT: profile FEAT_SPE Enable Statistical Profiling extension
// CHECK-NEXT: predres2 FEAT_SPECRES2 Enable Speculation Restriction Instruction
// CHECK-NEXT: ssbs FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
// CHECK-NEXT: ssve-aes FEAT_SSVE_AES Enable Armv9.6-A SVE AES support in streaming SVE mode
// CHECK-NEXT: ssve-aes FEAT_SSVE_AES Enable Armv9.6-A SVE2 AES support in streaming SVE mode
// CHECK-NEXT: ssve-fp8dot2 FEAT_SSVE_FP8DOT2 Enable SVE2 FP8 2-way dot product instructions
// CHECK-NEXT: ssve-fp8dot4 FEAT_SSVE_FP8DOT4 Enable SVE2 FP8 4-way dot product instructions
// CHECK-NEXT: ssve-fp8fma FEAT_SSVE_FP8FMA Enable SVE2 FP8 multiply-add instructions
// CHECK-NEXT: sve FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
// CHECK-NEXT: sve-aes FEAT_SVE_AES, FEAT_SVE_PMULL128 Enable SVE AES and quadword SVE polynomial multiply instructions
// CHECK-NEXT: sve-aes2 FEAT_SVE_AES2 Enable Armv9.6-A SVE multi-vector AES and multi-vector quadword polynomial multiply instructions
// CHECK-NEXT: sve-aes2 FEAT_SVE_AES2 Enable Armv9.6-A SVE multi-vector AES and 128-bit PMULL instructions
// CHECK-NEXT: sve-b16b16 FEAT_SVE_B16B16 Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions
// CHECK-NEXT: sve-bfscale FEAT_SVE_BFSCALE Enable Armv9.6-A SVE BFloat16 scaling instructions
// CHECK-NEXT: sve-f16f32mm FEAT_SVE_F16F32MM Enable Armv9.6-A FP16 to FP32 Matrix Multiply
// CHECK-NEXT: sve2 FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
// CHECK-NEXT: sve2-aes An alias of +sve2+sve-aes
// CHECK-NEXT: sve2-aes FEAT_SVE_AES, FEAT_SVE_PMULL128 Enable AES SVE2 instructions
// CHECK-NEXT: sve2-bitperm FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
// CHECK-NEXT: sve2-sha3 FEAT_SVE_SHA3 Enable SHA3 SVE2 instructions
// CHECK-NEXT: sve2-sm4 FEAT_SVE_SM4 Enable SM4 SVE2 instructions
Expand Down
3 changes: 1 addition & 2 deletions clang/test/Misc/warning-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This test serves two purposes:

The list of warnings below should NEVER grow. It should gradually shrink to 0.

CHECK: Warnings without flags (62):
CHECK: Warnings without flags (61):

CHECK-NEXT: ext_expected_semi_decl_list
CHECK-NEXT: ext_missing_whitespace_after_macro_name
Expand Down Expand Up @@ -76,7 +76,6 @@ CHECK-NEXT: warn_register_objc_catch_parm
CHECK-NEXT: warn_related_result_type_compatibility_class
CHECK-NEXT: warn_related_result_type_compatibility_protocol
CHECK-NEXT: warn_template_export_unsupported
CHECK-NEXT: warn_typecheck_function_qualifiers
CHECK-NEXT: warn_undef_interface
CHECK-NEXT: warn_undef_interface_suggest
CHECK-NEXT: warn_undef_protocolref
Expand Down
12 changes: 0 additions & 12 deletions clang/test/Preprocessor/aarch64-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,8 @@
// CHECK-NONEON-NOT: __ARM_FEATURE_SVE 1
// CHECK-NONEON-NOT: __ARM_NEON 1

// RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve-aes -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVEAES %s
// CHECK-SVEAES: __ARM_FEATURE_AES 1

// RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve2-aes -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2AES %s
// CHECK-SVE2AES: __ARM_FEATURE_AES 1
// CHECK-SVE2AES: __ARM_FEATURE_SVE2 1
// CHECK-SVE2AES: __ARM_FEATURE_SVE2_AES 1

// RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve-aes+sve2 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVEAES-SVE2 %s
// CHECK-SVEAES-SVE2: __ARM_FEATURE_AES 1
// CHECK-SVEAES-SVE2: __ARM_FEATURE_SVE2 1
// CHECK-SVEAES-SVE2: __ARM_FEATURE_SVE2_AES 1


// RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve2-sha3 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2SHA3 %s
// CHECK-SVE2SHA3: __ARM_FEATURE_SVE2_SHA3 1
// RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve2-sm4 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2SM4 %s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

void test(uint8_t u8, uint16_t u16, uint32_t u32, uint64_t u64)
{
// expected-error@+2 {{'svaesd_u8' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svaesd' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svaesd_u8' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svaesd' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svaesd,_u8,,)(svundef_u8(), svundef_u8());
// expected-error@+2 {{'svaese_u8' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svaese' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svaese_u8' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svaese' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svaese,_u8,,)(svundef_u8(), svundef_u8());
// expected-error@+2 {{'svaesimc_u8' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svaesimc' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svaesimc_u8' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svaesimc' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svaesimc,_u8,,)(svundef_u8());
// expected-error@+2 {{'svaesmc_u8' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svaesmc' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svaesmc_u8' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svaesmc' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svaesmc,_u8,,)(svundef_u8());
// expected-error@+2 {{'svbdep_u8' needs target feature sve,sve2-bitperm}}
// overload-error@+1 {{'svbdep' needs target feature sve,sve2-bitperm}}
Expand Down Expand Up @@ -107,17 +107,17 @@ void test(uint8_t u8, uint16_t u16, uint32_t u32, uint64_t u64)
// expected-error@+2 {{'svbgrp_n_u64' needs target feature sve,sve2-bitperm}}
// overload-error@+1 {{'svbgrp' needs target feature sve,sve2-bitperm}}
SVE_ACLE_FUNC(svbgrp,_n_u64,,)(svundef_u64(), u64);
// expected-error@+2 {{'svpmullb_pair_u64' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svpmullb_pair' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svpmullb_pair_u64' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svpmullb_pair' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svpmullb_pair,_u64,,)(svundef_u64(), svundef_u64());
// expected-error@+2 {{'svpmullb_pair_n_u64' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svpmullb_pair' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svpmullb_pair_n_u64' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svpmullb_pair' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svpmullb_pair,_n_u64,,)(svundef_u64(), u64);
// expected-error@+2 {{'svpmullt_pair_u64' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svpmullt_pair' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svpmullt_pair_u64' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svpmullt_pair' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svpmullt_pair,_u64,,)(svundef_u64(), svundef_u64());
// expected-error@+2 {{'svpmullt_pair_n_u64' needs target feature sve,sve2,sve-aes}}
// overload-error@+1 {{'svpmullt_pair' needs target feature sve,sve2,sve-aes}}
// expected-error@+2 {{'svpmullt_pair_n_u64' needs target feature sve,sve2-aes}}
// overload-error@+1 {{'svpmullt_pair' needs target feature sve,sve2-aes}}
SVE_ACLE_FUNC(svpmullt_pair,_n_u64,,)(svundef_u64(), u64);
// expected-error@+2 {{'svrax1_u64' needs target feature sve,sve2-sha3}}
// overload-error@+1 {{'svrax1' needs target feature sve,sve2-sha3}}
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/declspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ int gv2;
static void buggy(int *x) { }

// Type qualifiers.
typedef int f(void);
typedef int f(void);
typedef f* fptr;
const f* v1; // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}}
const f* v1; // expected-warning {{'const' qualifier on function type 'f' (aka 'int (void)') has no effect and is a Clang extension}}
__restrict__ f* v2; // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}}
__restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
f *__restrict__ v4; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
Expand Down
6 changes: 3 additions & 3 deletions clang/test/SemaOpenACC/compute-construct-default-clause.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ void SingleOnly() {
// expected-warning@+2{{OpenACC clause 'default' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'copy' not yet implemented}}
#pragma acc parallel loop self default(present) private(i) default(none) copy(i)
while(0);
for(int i = 0; i < 5; ++i);

// expected-warning@+3{{OpenACC clause 'self' not yet implemented, clause ignored}}
// expected-warning@+2{{OpenACC construct 'serial loop' not yet implemented}}
// expected-error@+1{{expected '('}}
#pragma acc serial loop self default private(i) default(none) if(i)
while(0);
for(int i = 0; i < 5; ++i);

// expected-warning@+2{{OpenACC construct 'kernels loop' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'default' not yet implemented}}
#pragma acc kernels loop default(none)
while(0);
for(int i = 0; i < 5; ++i);

// expected-warning@+2{{OpenACC construct 'data' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'default' not yet implemented}}
Expand Down
6 changes: 3 additions & 3 deletions clang/test/SemaOpenACC/compute-construct-if-clause.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ void BoolExpr(int *I, float *F) {
// expected-warning@+2{{OpenACC construct 'parallel loop' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
#pragma acc parallel loop if (*I < *F)
while(0);
for(int i = 0; i < 5; ++i);
// expected-warning@+2{{OpenACC construct 'serial loop' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
#pragma acc serial loop if (*I < *F)
while(0);
for(int i = 0; i < 5; ++i);
// expected-warning@+2{{OpenACC construct 'kernels loop' not yet implemented}}
// expected-warning@+1{{OpenACC clause 'if' not yet implemented}}
#pragma acc kernels loop if (*I < *F)
while(0);
for(int i = 0; i < 5; ++i);

// expected-error@+1{{OpenACC 'if' clause is not valid on 'loop' directive}}
#pragma acc loop if(I)
Expand Down
22 changes: 11 additions & 11 deletions clang/test/SemaOpenACC/loop-ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ void NormalFunc() {
// CHECK-NEXT: CompoundStmt
{
#pragma acc parallel
// CHECK-NEXT: OpenACCComputeConstruct [[PAR_ADDR:[0-9a-fx]+]] {{.*}}parallel
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
// CHECK-NEXT: CompoundStmt
{
#pragma acc loop
for(int i = 0; i < 5;++i);
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: [[PAR_ADDR]]
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl {{.*}} used i 'int'
Expand Down Expand Up @@ -91,16 +91,16 @@ void TemplFunc() {

}

#pragma acc parallel
#pragma acc serial
{
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
// CHECK-NEXT: CompoundStmt
#pragma acc parallel
{
// CHECK-NEXT: OpenACCComputeConstruct [[PAR_ADDR_UNINST:[0-9a-fx]+]] {{.*}}parallel
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
// CHECK-NEXT: CompoundStmt
#pragma acc loop
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: [[PAR_ADDR_UNINST]]
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl {{.*}} i 'int'
Expand All @@ -116,7 +116,7 @@ void TemplFunc() {
for(int i = 0; i < 5;++i);

#pragma acc loop
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: [[PAR_ADDR_UNINST]]
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl {{.*}} i 'int'
Expand Down Expand Up @@ -166,13 +166,13 @@ void TemplFunc() {
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl{{.*}} I 'typename S::type':'int'

// CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
// CHECK-NEXT: CompoundStmt
//
// CHECK-NEXT: OpenACCComputeConstruct [[PAR_ADDR_INST:[0-9a-fx]+]] {{.*}}parallel
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
// CHECK-NEXT: CompoundStmt

// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: [[PAR_ADDR_INST]]
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl {{.*}} i 'int'
Expand All @@ -186,7 +186,7 @@ void TemplFunc() {
// CHECK-NEXT: DeclRefExpr{{.*}} 'i' 'int'
// CHECK-NEXT: NullStmt

// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: [[PAR_ADDR_INST]]
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl {{.*}} i 'int'
Expand Down
52 changes: 26 additions & 26 deletions clang/test/SemaOpenACC/loop-construct-gang-ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void NormalUses() {
#pragma acc loop gang(static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: gang clause num
// CHECK-NEXT: IntegerLiteral{{.*}}'int' 1
// CHECK-NEXT: gang clause static
Expand All @@ -76,8 +76,8 @@ void NormalUses() {
#pragma acc loop gang(num:1) gang(static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: gang clause dim static
// CHECK-NEXT: ConstantExpr{{.*}} 'int'
// CHECK-NEXT: value: Int 1
Expand All @@ -100,8 +100,8 @@ void NormalUses() {
#pragma acc loop gang(dim:1, static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause static
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}} 'Val' 'int'
Expand All @@ -121,8 +121,8 @@ void NormalUses() {
#pragma acc loop gang(static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause static
// CHECK-NEXT: OpenACCAsteriskSizeExpr
// CHECK-NEXT: ForStmt
Expand All @@ -141,8 +141,8 @@ void NormalUses() {
#pragma acc loop gang(static:*)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand Down Expand Up @@ -224,8 +224,8 @@ void TemplateUses(T Val) {
#pragma acc loop gang(static:*)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: gang clause dim
// CHECK-NEXT: DeclRefExpr{{.*}}'unsigned int' NonTypeTemplateParm{{.*}} 'One' 'unsigned int'
// CHECK-NEXT: gang clause static
Expand All @@ -246,8 +246,8 @@ void TemplateUses(T Val) {
#pragma acc loop gang(dim:One) gang(static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: gang clause dim static
// CHECK-NEXT: DeclRefExpr{{.*}}'unsigned int' NonTypeTemplateParm{{.*}} 'One' 'unsigned int'
// CHECK-NEXT: DeclRefExpr{{.*}}'T' lvalue ParmVar{{.*}} 'Val' 'T'
Expand All @@ -267,8 +267,8 @@ void TemplateUses(T Val) {
#pragma acc loop gang(dim:One, static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause static
// CHECK-NEXT: DeclRefExpr{{.*}}'T' lvalue ParmVar{{.*}} 'Val' 'T'
// CHECK-NEXT: ForStmt
Expand All @@ -287,8 +287,8 @@ void TemplateUses(T Val) {
#pragma acc loop gang(static:Val)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand Down Expand Up @@ -367,8 +367,8 @@ void TemplateUses(T Val) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: gang clause dim
// CHECK-NEXT: ConstantExpr{{.*}} 'unsigned int'
// CHECK-NEXT: value: Int 1
Expand All @@ -391,8 +391,8 @@ void TemplateUses(T Val) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: gang clause dim static
// CHECK-NEXT: ConstantExpr{{.*}} 'unsigned int'
// CHECK-NEXT: value: Int 1
Expand All @@ -414,8 +414,8 @@ void TemplateUses(T Val) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause static
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue ParmVar{{.*}} 'Val' 'int'
Expand All @@ -432,8 +432,8 @@ void TemplateUses(T Val) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: gang clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand Down
52 changes: 26 additions & 26 deletions clang/test/SemaOpenACC/loop-construct-vector-ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop vector(length:CTI)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: vector clause
// CHECK-NEXT: DeclRefExpr{{.*}}'Int' lvalue ParmVar{{.*}}'IsI' 'Int'
// CHECK-NEXT: ForStmt
Expand All @@ -90,8 +90,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop vector(length:IsI)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: vector clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -109,8 +109,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop vector
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: vector clause
// CHECK-NEXT: DeclRefExpr{{.*}}'Int' lvalue ParmVar{{.*}}'IsI' 'Int'
// CHECK-NEXT: ForStmt
Expand Down Expand Up @@ -194,8 +194,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue ParmVar{{.*}}'IsI' 'int'
Expand All @@ -212,8 +212,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: vector clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -228,8 +228,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue ParmVar{{.*}}'IsI' 'int'
Expand Down Expand Up @@ -330,8 +330,8 @@ void uses() {
#pragma acc loop vector(length:C)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: vector clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -349,8 +349,8 @@ void uses() {
#pragma acc loop vector
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <UserDefinedConversion>
// CHECK-NEXT: CXXMemberCallExpr{{.*}}'int'
Expand All @@ -372,8 +372,8 @@ void uses() {
#pragma acc loop vector(C)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue Var
Expand All @@ -393,8 +393,8 @@ void uses() {
#pragma acc loop vector(length:i)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: vector clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -412,8 +412,8 @@ void uses() {
#pragma acc loop vector
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <UserDefinedConversion>
// CHECK-NEXT: CXXMemberCallExpr{{.*}}'int'
Expand All @@ -435,8 +435,8 @@ void uses() {
#pragma acc loop vector(C)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: vector clause
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue Var
Expand All @@ -456,8 +456,8 @@ void uses() {
#pragma acc loop vector(length:i)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: vector clause
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand Down
56 changes: 28 additions & 28 deletions clang/test/SemaOpenACC/loop-construct-worker-ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop worker
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -53,8 +53,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop worker
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -72,8 +72,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop worker
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: DeclRefExpr{{.*}} 'ConvertsToInt' lvalue ParmVar
// CHECK-NEXT: ForStmt
Expand All @@ -92,8 +92,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop worker(CTI)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: DeclRefExpr{{.*}} 'Int' lvalue ParmVar
// CHECK-NEXT: ForStmt
Expand All @@ -112,8 +112,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
#pragma acc loop worker(num:IsI)
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: DeclRefExpr{{.*}} 'unsigned int' NonTypeTemplateParm{{.*}}'I' 'unsigned int'
// CHECK-NEXT: ForStmt
Expand Down Expand Up @@ -159,8 +159,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -175,8 +175,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -191,8 +191,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ImplicitCastExpr{{.*}} 'int' <UserDefinedConversion>
// CHECK-NEXT: CXXMemberCallExpr{{.*}} 'int'
Expand All @@ -211,8 +211,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ImplicitCastExpr{{.*}} 'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}} 'int' lvalue ParmVar{{.*}} 'IsI' 'int'
Expand All @@ -229,8 +229,8 @@ void TemplUses(ConvertsToInt CTI, Int IsI) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: SubstNonTypeTemplateParmExpr{{.*}}'unsigned int'
// CHECK-NEXT: NonTypeTemplateParmDecl{{.*}}'unsigned int' depth 0 index 0 I
Expand Down Expand Up @@ -277,8 +277,8 @@ void uses() {
#pragma acc loop worker
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} parallel
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: parallel
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -296,8 +296,8 @@ void uses() {
#pragma acc loop worker
for(int i = 0; i < 5; ++i);

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} serial
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: serial
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ForStmt
// CHECK-NEXT: DeclStmt
Expand All @@ -320,8 +320,8 @@ void uses() {
// CHECK-NEXT: VarDecl
// CHECK-NEXT: CXXConstructExpr

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <UserDefinedConversion>
// CHECK-NEXT: CXXMemberCallExpr{{.*}} 'int'
Expand All @@ -347,8 +347,8 @@ void uses() {
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl

// CHECK-NEXT: OpenACCComputeConstruct 0x[[COMPUTE_ADDR:[0-9a-f]+]]{{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: 0x[[COMPUTE_ADDR]]
// CHECK-NEXT: OpenACCComputeConstruct {{.*}} kernels
// CHECK-NEXT: OpenACCLoopConstruct{{.*}} parent: kernels
// CHECK-NEXT: worker clause{{.*}}
// CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <LValueToRValue>
// CHECK-NEXT: DeclRefExpr{{.*}}'int' lvalue Var
Expand Down
3 changes: 3 additions & 0 deletions clang/utils/perf-training/bolt.lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ config.substitutions.append(("%clang_cpp", f" {config.clang} --driver-mode=g++ "
config.substitutions.append(("%clang_skip_driver", config.clang))
config.substitutions.append(("%clang", config.clang))
config.substitutions.append(("%test_root", config.test_exec_root))
config.substitutions.append(('%cmake_generator', config.cmake_generator))
config.substitutions.append(('%cmake', config.cmake_exe))
config.substitutions.append(('%llvm_src_dir', config.llvm_src_dir))
3 changes: 3 additions & 0 deletions clang/utils/perf-training/bolt.lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ config.python_exe = "@Python3_EXECUTABLE@"
config.clang_obj_root = path(r"@CLANG_BINARY_DIR@")
config.clang_bolt_mode = "@CLANG_BOLT@"
config.clang_bolt_name = "@CLANG_BOLT_INSTRUMENTED@"
config.cmake_exe = "@CMAKE_COMMAND@"
config.llvm_src_dir ="@CMAKE_SOURCE_DIR@"
config.cmake_generator ="@CMAKE_GENERATOR@"

# Let the main config do the real work.
lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/bolt.lit.cfg")
5 changes: 4 additions & 1 deletion clang/utils/perf-training/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ config.test_format = lit.formats.ShTest(use_lit_shell == "0")
config.substitutions.append( ('%clang_cpp_skip_driver', ' %s %s %s ' % (cc1_wrapper, config.clang, sysroot_flags)))
config.substitutions.append( ('%clang_cpp', ' %s --driver-mode=g++ %s ' % (config.clang, sysroot_flags)))
config.substitutions.append( ('%clang_skip_driver', ' %s %s %s ' % (cc1_wrapper, config.clang, sysroot_flags)))
config.substitutions.append( ('%clang', ' %s %s ' % (config.clang, sysroot_flags) ) )
config.substitutions.append( ('%clang', '%s %s ' % (config.clang, sysroot_flags) ) )
config.substitutions.append( ('%test_root', config.test_exec_root ) )
config.substitutions.append( ('%cmake_generator', config.cmake_generator ) )
config.substitutions.append( ('%cmake', config.cmake_exe ) )
config.substitutions.append( ('%llvm_src_dir', config.llvm_src_dir ) )

config.environment['LLVM_PROFILE_FILE'] = 'perf-training-%4m.profraw'

3 changes: 3 additions & 0 deletions clang/utils/perf-training/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_exe = "@Python3_EXECUTABLE@"
config.cmake_exe = "@CMAKE_COMMAND@"
config.llvm_src_dir ="@CMAKE_SOURCE_DIR@"
config.cmake_generator ="@CMAKE_GENERATOR@"

# Let the main config do the real work.
lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/lit.cfg")
2 changes: 2 additions & 0 deletions clang/utils/perf-training/llvm-support/build.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RUN: %cmake -G %cmake_generator -B %t -S %llvm_src_dir -DCMAKE_C_COMPILER=%clang -DCMAKE_CXX_COMPILER=%clang -DCMAKE_CXX_FLAGS="--driver-mode=g++" -DCMAKE_BUILD_TYPE=Release
RUN: %cmake --build %t -v --target LLVMSupport
6 changes: 3 additions & 3 deletions clang/www/c_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ <h2 id="c2y">C2y implementation status</h2>
<tr>
<td>Slay Some Earthly Demons III</td>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3341.pdf">N3341</a></td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Slay Some Earthly Demons IV</td>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3342.pdf">N3342</a></td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Slay Some Earthly Demons VI</td>
Expand All @@ -211,7 +211,7 @@ <h2 id="c2y">C2y implementation status</h2>
<tr>
<td>Slay Some Earthly Demons VIII</td>
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3346.pdf">N3346</a></td>
<td class="unknown" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Introduce complex literals v. 2</td>
Expand Down
3 changes: 3 additions & 0 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ macro(add_custom_libcxx name prefix)
USES_TERMINAL_INSTALL 1
LIST_SEPARATOR |
EXCLUDE_FROM_ALL TRUE
# Ensure that DESTDIR=... set in the out environment does not affect this
# target (we always need to install to the build directory).
INSTALL_COMMAND env DESTDIR= ${CMAKE_COMMAND} --build ${prefix}/build --target install
INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
)

Expand Down
1 change: 1 addition & 0 deletions flang/include/flang/Parser/dump-parse-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class ParseTreeDumper {
NODE(parser, Call)
NODE(parser, CallStmt)
NODE(CallStmt, Chevrons)
NODE(CallStmt, StarOrExpr)
NODE(parser, CaseConstruct)
NODE(CaseConstruct, Case)
NODE(parser, CaseSelector)
Expand Down
8 changes: 4 additions & 4 deletions flang/include/flang/Parser/parse-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -3247,13 +3247,14 @@ struct FunctionReference {

// R1521 call-stmt -> CALL procedure-designator [ chevrons ]
// [( [actual-arg-spec-list] )]
// (CUDA) chevrons -> <<< scalar-expr, scalar-expr [,
// (CUDA) chevrons -> <<< * | scalar-expr, scalar-expr [,
// scalar-int-expr [, scalar-int-expr ] ] >>>
struct CallStmt {
BOILERPLATE(CallStmt);
WRAPPER_CLASS(StarOrExpr, std::optional<ScalarExpr>);
struct Chevrons {
TUPLE_CLASS_BOILERPLATE(Chevrons);
std::tuple<ScalarExpr, ScalarExpr, std::optional<ScalarIntExpr>,
std::tuple<StarOrExpr, ScalarExpr, std::optional<ScalarIntExpr>,
std::optional<ScalarIntExpr>>
t;
};
Expand Down Expand Up @@ -3694,9 +3695,8 @@ struct OmpMapClause {

// 2.9.5 order-clause -> ORDER ([order-modifier :]concurrent)
struct OmpOrderModifier {
UNION_CLASS_BOILERPLATE(OmpOrderModifier);
ENUM_CLASS(Kind, Reproducible, Unconstrained)
std::variant<Kind> u;
WRAPPER_CLASS_BOILERPLATE(OmpOrderModifier, Kind);
};

struct OmpOrderClause {
Expand Down
3 changes: 1 addition & 2 deletions flang/lib/Lower/OpenMP/Clauses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,7 @@ Order make(const parser::OmpClause::Order &inp,
auto &t1 = std::get<wrapped::Type>(inp.v.t);

auto convert3 = [&](const parser::OmpOrderModifier &s) {
return Fortran::common::visit(
[&](parser::OmpOrderModifier::Kind k) { return convert1(k); }, s.u);
return convert1(s.v);
};
return Order{
{/*OrderModifier=*/maybeApply(convert3, t0), /*Ordering=*/convert2(t1)}};
Expand Down
7 changes: 7 additions & 0 deletions flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ struct CUFAllocOpConversion : public mlir::OpRewritePattern<cuf::AllocOp> {
seqTy.getConstantArraySize());
}
bytes = rewriter.create<mlir::arith::MulIOp>(loc, nbElem, width);
} else if (fir::isa_derived(op.getInType())) {
mlir::Type structTy = typeConverter->convertType(op.getInType());
std::size_t structSize = dl->getTypeSizeInBits(structTy) / 8;
bytes = builder.createIntegerConstant(loc, builder.getIndexType(),
structSize);
} else {
mlir::emitError(loc, "unsupported type in cuf.alloc\n");
}
mlir::func::FuncOp func =
fir::runtime::getRuntimeFunc<mkRTKey(CUFMemAlloc)>(loc, builder);
Expand Down
7 changes: 5 additions & 2 deletions flang/lib/Parser/program-parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,13 @@ TYPE_CONTEXT_PARSER("function reference"_en_US,

// R1521 call-stmt -> CALL procedure-designator [chevrons]
/// [( [actual-arg-spec-list] )]
// (CUDA) chevrons -> <<< scalar-expr, scalar-expr [, scalar-int-expr
// (CUDA) chevrons -> <<< * | scalar-expr, scalar-expr [, scalar-int-expr
// [, scalar-int-expr ] ] >>>
constexpr auto starOrExpr{
construct<CallStmt::StarOrExpr>("*" >> pure<std::optional<ScalarExpr>>() ||
applyFunction(presentOptional<ScalarExpr>, scalarExpr))};
TYPE_PARSER(extension<LanguageFeature::CUDA>(
"<<<" >> construct<CallStmt::Chevrons>(scalarExpr, "," >> scalarExpr,
"<<<" >> construct<CallStmt::Chevrons>(starOrExpr, ", " >> scalarExpr,
maybe("," >> scalarIntExpr), maybe("," >> scalarIntExpr)) /
">>>"))
constexpr auto actualArgSpecList{optionalList(actualArgSpec)};
Expand Down
7 changes: 7 additions & 0 deletions flang/lib/Parser/unparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,13 @@ class UnparseVisitor {
void Unparse(const IntrinsicStmt &x) { // R1519
Word("INTRINSIC :: "), Walk(x.v, ", ");
}
void Unparse(const CallStmt::StarOrExpr &x) {
if (x.v) {
Walk(*x.v);
} else {
Word("*");
}
}
void Unparse(const CallStmt::Chevrons &x) { // CUDA
Walk(std::get<0>(x.t)); // grid
Word(","), Walk(std::get<1>(x.t)); // block
Expand Down
14 changes: 10 additions & 4 deletions flang/lib/Semantics/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3066,11 +3066,17 @@ std::optional<Chevrons> ExpressionAnalyzer::AnalyzeChevrons(
return false;
}};
if (const auto &chevrons{call.chevrons}) {
if (auto expr{Analyze(std::get<0>(chevrons->t))};
expr && checkLaunchArg(*expr, "grid")) {
result.emplace_back(*expr);
auto &starOrExpr{std::get<0>(chevrons->t)};
if (starOrExpr.v) {
if (auto expr{Analyze(*starOrExpr.v)};
expr && checkLaunchArg(*expr, "grid")) {
result.emplace_back(*expr);
} else {
return std::nullopt;
}
} else {
return std::nullopt;
result.emplace_back(
AsGenericExpr(evaluate::Constant<evaluate::CInteger>{-1}));
}
if (auto expr{Analyze(std::get<1>(chevrons->t))};
expr && checkLaunchArg(*expr, "block")) {
Expand Down
Loading