clang 22.0.0git
SemaAMDGPU.h
Go to the documentation of this file.
1//===----- SemaAMDGPU.h --- AMDGPU target-specific routines ---*- C++ -*---===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file declares semantic analysis functions specific to AMDGPU.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SEMA_SEMAAMDGPU_H
14#define LLVM_CLANG_SEMA_SEMAAMDGPU_H
15
16#include "clang/AST/ASTFwd.h"
17#include "clang/Sema/SemaBase.h"
18
19namespace clang {
21class ParsedAttr;
22
23class SemaAMDGPU : public SemaBase {
24public:
25 SemaAMDGPU(Sema &S);
26
27 bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
28
29 bool checkCoopAtomicFunctionCall(CallExpr *TheCall, bool IsStore);
30
31 bool checkMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs,
32 unsigned NumDataArgs);
33
34 /// Create an AMDGPUWavesPerEUAttr attribute.
35 AMDGPUFlatWorkGroupSizeAttr *
37 Expr *Max);
38
39 /// addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size
40 /// attribute to a particular declaration.
42 Expr *Min, Expr *Max);
43
44 /// Create an AMDGPUWavesPerEUAttr attribute.
45 AMDGPUWavesPerEUAttr *
47 Expr *Max);
48
49 /// addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a
50 /// particular declaration.
52 Expr *Min, Expr *Max);
53
54 /// Create an AMDGPUMaxNumWorkGroupsAttr attribute.
55 AMDGPUMaxNumWorkGroupsAttr *
57 Expr *YExpr, Expr *ZExpr);
58
59 /// addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups
60 /// attribute to a particular declaration.
62 Expr *XExpr, Expr *YExpr, Expr *ZExpr);
63
64 void handleAMDGPUWavesPerEUAttr(Decl *D, const ParsedAttr &AL);
65 void handleAMDGPUNumSGPRAttr(Decl *D, const ParsedAttr &AL);
66 void handleAMDGPUNumVGPRAttr(Decl *D, const ParsedAttr &AL);
69};
70} // namespace clang
71
72#endif // LLVM_CLANG_SEMA_SEMAAMDGPU_H
Forward declaration of all AST node types.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2879
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
This represents one expression.
Definition Expr.h:112
ParsedAttr - Represents a syntactic attribute.
Definition ParsedAttr.h:119
void handleAMDGPUMaxNumWorkGroupsAttr(Decl *D, const ParsedAttr &AL)
void addAMDGPUFlatWorkGroupSizeAttr(Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size attribute to a particular declar...
bool checkCoopAtomicFunctionCall(CallExpr *TheCall, bool IsStore)
void handleAMDGPUFlatWorkGroupSizeAttr(Decl *D, const ParsedAttr &AL)
void handleAMDGPUNumSGPRAttr(Decl *D, const ParsedAttr &AL)
AMDGPUMaxNumWorkGroupsAttr * CreateAMDGPUMaxNumWorkGroupsAttr(const AttributeCommonInfo &CI, Expr *XExpr, Expr *YExpr, Expr *ZExpr)
Create an AMDGPUMaxNumWorkGroupsAttr attribute.
AMDGPUWavesPerEUAttr * CreateAMDGPUWavesPerEUAttr(const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
Create an AMDGPUWavesPerEUAttr attribute.
void handleAMDGPUNumVGPRAttr(Decl *D, const ParsedAttr &AL)
AMDGPUFlatWorkGroupSizeAttr * CreateAMDGPUFlatWorkGroupSizeAttr(const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
Create an AMDGPUWavesPerEUAttr attribute.
bool checkMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs, unsigned NumDataArgs)
void handleAMDGPUWavesPerEUAttr(Decl *D, const ParsedAttr &AL)
bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
void addAMDGPUWavesPerEUAttr(Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a particular declaration.
void addAMDGPUMaxNumWorkGroupsAttr(Decl *D, const AttributeCommonInfo &CI, Expr *XExpr, Expr *YExpr, Expr *ZExpr)
addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups attribute to a particular declarat...
SemaBase(Sema &S)
Definition SemaBase.cpp:7
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:854
The JSON file list parser is used to communicate input to InstallAPI.