1 //=- KernelInfo.h - Kernel Analysis -------------------------------*- 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 // 9 // This file defines the KernelInfoPrinter class used to emit remarks about 10 // function properties from a GPU kernel. 11 // 12 // See llvm/docs/KernelInfo.rst. 13 // ===---------------------------------------------------------------------===// 14 15 #ifndef LLVM_ANALYSIS_KERNELINFO_H 16 #define LLVM_ANALYSIS_KERNELINFO_H 17 18 #include "llvm/IR/PassManager.h" 19 20 namespace llvm { 21 22 class TargetMachine; 23 24 class KernelInfoPrinter : public PassInfoMixin<KernelInfoPrinter> { 25 TargetMachine *TM; 26 27 public: KernelInfoPrinter(TargetMachine * TM)28 explicit KernelInfoPrinter(TargetMachine *TM) : TM(TM) {} 29 30 PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); 31 isRequired()32 static bool isRequired() { return true; } 33 }; 34 } // namespace llvm 35 #endif // LLVM_ANALYSIS_KERNELINFO_H 36