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 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H |
| 16 | #define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 17 | |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/MachineFunctionAnalysis.h" |
Chandler Carruth | b81dfa6 | 2015-01-28 04:57:56 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/StackProtector.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 20 | #include "llvm/IR/DataLayout.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 21 | #include "llvm/Pass.h" |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 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 | |
Craig Topper | 2865c98 | 2014-04-29 07:57:44 +0000 | [diff] [blame] | 31 | void getAnalysisUsage(AnalysisUsage &AU) const override { |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 32 | AU.addPreserved<MachineFunctionAnalysis>(); |
Chandler Carruth | b81dfa6 | 2015-01-28 04:57:56 +0000 | [diff] [blame] | 33 | AU.addPreserved<StackProtector>(); |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Craig Topper | 2865c98 | 2014-04-29 07:57:44 +0000 | [diff] [blame] | 36 | bool runOnFunction(Function &F) override; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 37 | |
| 38 | static const unsigned MaxAggrCopySize = 128; |
| 39 | |
Craig Topper | 2865c98 | 2014-04-29 07:57:44 +0000 | [diff] [blame] | 40 | const char *getPassName() const override { |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 41 | return "Lower aggregate copies/intrinsics into loops"; |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | extern FunctionPass *createLowerAggrCopies(); |
| 46 | } |
| 47 | |
| 48 | #endif |