clang 20.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 {
20class AttributeCommonInfo;
21class ParsedAttr;
22
23class SemaAMDGPU : public SemaBase {
24public:
25 SemaAMDGPU(Sema &S);
26
27 bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
28
29 bool checkMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs,
30 unsigned NumDataArgs);
31
32 /// Create an AMDGPUWavesPerEUAttr attribute.
33 AMDGPUFlatWorkGroupSizeAttr *
35 Expr *Max);
36
37 /// addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size
38 /// attribute to a particular declaration.
40 Expr *Min, Expr *Max);
41
42 /// Create an AMDGPUWavesPerEUAttr attribute.
43 AMDGPUWavesPerEUAttr *
45 Expr *Max);
46
47 /// addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a
48 /// particular declaration.
50 Expr *Min, Expr *Max);
51
52 /// Create an AMDGPUMaxNumWorkGroupsAttr attribute.
53 AMDGPUMaxNumWorkGroupsAttr *
55 Expr *YExpr, Expr *ZExpr);
56
57 /// addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups
58 /// attribute to a particular declaration.
60 Expr *XExpr, Expr *YExpr, Expr *ZExpr);
61
63 void handleAMDGPUNumSGPRAttr(Decl *D, const ParsedAttr &AL);
64 void handleAMDGPUNumVGPRAttr(Decl *D, const ParsedAttr &AL);
67};
68} // namespace clang
69
70#endif // LLVM_CLANG_SEMA_SEMAAMDGPU_H
Forward declaration of all AST node types.
const Decl * D
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2874
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
This represents one expression.
Definition: Expr.h:110
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
void handleAMDGPUMaxNumWorkGroupsAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAMDGPU.cpp:363
void addAMDGPUFlatWorkGroupSizeAttr(Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size attribute to a particular declar...
Definition: SemaAMDGPU.cpp:212
void handleAMDGPUFlatWorkGroupSizeAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAMDGPU.cpp:219
void handleAMDGPUNumSGPRAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAMDGPU.cpp:289
AMDGPUMaxNumWorkGroupsAttr * CreateAMDGPUMaxNumWorkGroupsAttr(const AttributeCommonInfo &CI, Expr *XExpr, Expr *YExpr, Expr *ZExpr)
Create an AMDGPUMaxNumWorkGroupsAttr attribute.
Definition: SemaAMDGPU.cpp:342
AMDGPUWavesPerEUAttr * CreateAMDGPUWavesPerEUAttr(const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
Create an AMDGPUWavesPerEUAttr attribute.
Definition: SemaAMDGPU.cpp:262
void handleAMDGPUNumVGPRAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAMDGPU.cpp:299
AMDGPUFlatWorkGroupSizeAttr * CreateAMDGPUFlatWorkGroupSizeAttr(const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
Create an AMDGPUWavesPerEUAttr attribute.
Definition: SemaAMDGPU.cpp:201
bool checkMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs, unsigned NumDataArgs)
Definition: SemaAMDGPU.cpp:132
void handleAMDGPUWavesPerEUAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAMDGPU.cpp:279
bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaAMDGPU.cpp:25
void addAMDGPUWavesPerEUAttr(Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max)
addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a particular declaration.
Definition: SemaAMDGPU.cpp:273
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...
Definition: SemaAMDGPU.cpp:355
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:463
The JSON file list parser is used to communicate input to InstallAPI.