| Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 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 NVPTX_LOWER_AGGR_COPIES_H |
| 16 | #define NVPTX_LOWER_AGGR_COPIES_H |
| 17 | |
| Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/MachineFunctionAnalysis.h" |
| Micah Villmow | cdfe20b | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 19 | #include "llvm/DataLayout.h" |
| Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame^] | 20 | #include "llvm/Pass.h" |
| Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | // actual analysis class, which is a functionpass |
| 25 | struct NVPTXLowerAggrCopies : public FunctionPass { |
| 26 | static char ID; |
| 27 | |
| 28 | NVPTXLowerAggrCopies() : FunctionPass(ID) {} |
| 29 | |
| 30 | void getAnalysisUsage(AnalysisUsage &AU) const { |
| Micah Villmow | cdfe20b | 2012-10-08 16:38:25 +0000 | [diff] [blame] | 31 | AU.addRequired<DataLayout>(); |
| Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 32 | AU.addPreserved<MachineFunctionAnalysis>(); |
| 33 | } |
| 34 | |
| 35 | virtual bool runOnFunction(Function &F); |
| 36 | |
| 37 | static const unsigned MaxAggrCopySize = 128; |
| 38 | |
| 39 | virtual const char *getPassName() const { |
| 40 | return "Lower aggregate copies/intrinsics into loops"; |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | extern FunctionPass *createLowerAggrCopies(); |
| 45 | } |
| 46 | |
| 47 | #endif |