DataLayout: Report when the preferred alignment is less than the ABI
[oota-llvm.git] / lib / Target / NVPTX / NVPTXLowerAggrCopies.h
1 //===-- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h ------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the NVIDIA specific lowering of
11 // aggregate copies
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
16 #define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
17
18 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
19 #include "llvm/CodeGen/StackProtector.h"
20 #include "llvm/IR/DataLayout.h"
21 #include "llvm/Pass.h"
22
23 namespace llvm {
24
25 // actual analysis class, which is a functionpass
26 struct NVPTXLowerAggrCopies : public FunctionPass {
27   static char ID;
28
29   NVPTXLowerAggrCopies() : FunctionPass(ID) {}
30
31   void getAnalysisUsage(AnalysisUsage &AU) const override {
32     AU.addRequired<DataLayoutPass>();
33     AU.addPreserved<MachineFunctionAnalysis>();
34     AU.addPreserved<StackProtector>();
35   }
36
37   bool runOnFunction(Function &F) override;
38
39   static const unsigned MaxAggrCopySize = 128;
40
41   const char *getPassName() const override {
42     return "Lower aggregate copies/intrinsics into loops";
43   }
44 };
45
46 extern FunctionPass *createLowerAggrCopies();
47 }
48
49 #endif