Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:04

0001 //===----- SemaAMDGPU.h --- AMDGPU target-specific routines ---*- C++ -*---===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 /// This file declares semantic analysis functions specific to AMDGPU.
0010 ///
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CLANG_SEMA_SEMAAMDGPU_H
0014 #define LLVM_CLANG_SEMA_SEMAAMDGPU_H
0015 
0016 #include "clang/AST/ASTFwd.h"
0017 #include "clang/Sema/SemaBase.h"
0018 
0019 namespace clang {
0020 class AttributeCommonInfo;
0021 class ParsedAttr;
0022 
0023 class SemaAMDGPU : public SemaBase {
0024 public:
0025   SemaAMDGPU(Sema &S);
0026 
0027   bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
0028 
0029   bool checkMovDPPFunctionCall(CallExpr *TheCall, unsigned NumArgs,
0030                                unsigned NumDataArgs);
0031 
0032   /// Create an AMDGPUWavesPerEUAttr attribute.
0033   AMDGPUFlatWorkGroupSizeAttr *
0034   CreateAMDGPUFlatWorkGroupSizeAttr(const AttributeCommonInfo &CI, Expr *Min,
0035                                     Expr *Max);
0036 
0037   /// addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size
0038   /// attribute to a particular declaration.
0039   void addAMDGPUFlatWorkGroupSizeAttr(Decl *D, const AttributeCommonInfo &CI,
0040                                       Expr *Min, Expr *Max);
0041 
0042   /// Create an AMDGPUWavesPerEUAttr attribute.
0043   AMDGPUWavesPerEUAttr *
0044   CreateAMDGPUWavesPerEUAttr(const AttributeCommonInfo &CI, Expr *Min,
0045                              Expr *Max);
0046 
0047   /// addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a
0048   /// particular declaration.
0049   void addAMDGPUWavesPerEUAttr(Decl *D, const AttributeCommonInfo &CI,
0050                                Expr *Min, Expr *Max);
0051 
0052   /// Create an AMDGPUMaxNumWorkGroupsAttr attribute.
0053   AMDGPUMaxNumWorkGroupsAttr *
0054   CreateAMDGPUMaxNumWorkGroupsAttr(const AttributeCommonInfo &CI, Expr *XExpr,
0055                                    Expr *YExpr, Expr *ZExpr);
0056 
0057   /// addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups
0058   /// attribute to a particular declaration.
0059   void addAMDGPUMaxNumWorkGroupsAttr(Decl *D, const AttributeCommonInfo &CI,
0060                                      Expr *XExpr, Expr *YExpr, Expr *ZExpr);
0061 
0062   void handleAMDGPUWavesPerEUAttr(Decl *D, const ParsedAttr &AL);
0063   void handleAMDGPUNumSGPRAttr(Decl *D, const ParsedAttr &AL);
0064   void handleAMDGPUNumVGPRAttr(Decl *D, const ParsedAttr &AL);
0065   void handleAMDGPUMaxNumWorkGroupsAttr(Decl *D, const ParsedAttr &AL);
0066   void handleAMDGPUFlatWorkGroupSizeAttr(Decl *D, const ParsedAttr &AL);
0067 };
0068 } // namespace clang
0069 
0070 #endif // LLVM_CLANG_SEMA_SEMAAMDGPU_H