1239310Sdim//===-- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h ------------*- C++ -*-===//
2239310Sdim//
3239310Sdim//                     The LLVM Compiler Infrastructure
4239310Sdim//
5239310Sdim// This file is distributed under the University of Illinois Open Source
6239310Sdim// License. See LICENSE.TXT for details.
7239310Sdim//
8239310Sdim//===----------------------------------------------------------------------===//
9239310Sdim//
10239310Sdim// This file contains the declaration of the NVIDIA specific lowering of
11239310Sdim// aggregate copies
12239310Sdim//
13239310Sdim//===----------------------------------------------------------------------===//
14239310Sdim
15239310Sdim#ifndef NVPTX_LOWER_AGGR_COPIES_H
16239310Sdim#define NVPTX_LOWER_AGGR_COPIES_H
17239310Sdim
18249423Sdim#include "llvm/CodeGen/MachineFunctionAnalysis.h"
19249423Sdim#include "llvm/IR/DataLayout.h"
20239310Sdim#include "llvm/Pass.h"
21239310Sdim
22239310Sdimnamespace llvm {
23239310Sdim
24239310Sdim// actual analysis class, which is a functionpass
25239310Sdimstruct NVPTXLowerAggrCopies : public FunctionPass {
26239310Sdim  static char ID;
27239310Sdim
28239310Sdim  NVPTXLowerAggrCopies() : FunctionPass(ID) {}
29239310Sdim
30239310Sdim  void getAnalysisUsage(AnalysisUsage &AU) const {
31243830Sdim    AU.addRequired<DataLayout>();
32239310Sdim    AU.addPreserved<MachineFunctionAnalysis>();
33239310Sdim  }
34239310Sdim
35239310Sdim  virtual bool runOnFunction(Function &F);
36239310Sdim
37239310Sdim  static const unsigned MaxAggrCopySize = 128;
38239310Sdim
39239310Sdim  virtual const char *getPassName() const {
40239310Sdim    return "Lower aggregate copies/intrinsics into loops";
41239310Sdim  }
42239310Sdim};
43239310Sdim
44239310Sdimextern FunctionPass *createLowerAggrCopies();
45239310Sdim}
46239310Sdim
47239310Sdim#endif
48