1 //===-- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the NVIDIA specific lowering of
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
16 #define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
18 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Pass.h"
24 // actual analysis class, which is a functionpass
25 struct NVPTXLowerAggrCopies : public FunctionPass {
28 NVPTXLowerAggrCopies() : FunctionPass(ID) {}
30 void getAnalysisUsage(AnalysisUsage &AU) const override {
31 AU.addRequired<DataLayoutPass>();
32 AU.addPreserved("stack-protector");
33 AU.addPreserved<MachineFunctionAnalysis>();
36 bool runOnFunction(Function &F) override;
38 static const unsigned MaxAggrCopySize = 128;
40 const char *getPassName() const override {
41 return "Lower aggregate copies/intrinsics into loops";
45 extern FunctionPass *createLowerAggrCopies();