blob: 7b0a4aed522f433723f11e6ad1f6a109411b6396 [file] [log] [blame]
Justin Holewinskiae556d32012-05-04 20:18:50 +00001//===-- 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 Kramera7c40ef2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
16#define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
Justin Holewinskiae556d32012-05-04 20:18:50 +000017
Justin Holewinskiae556d32012-05-04 20:18:50 +000018#include "llvm/CodeGen/MachineFunctionAnalysis.h"
Chandler Carruthb81dfa62015-01-28 04:57:56 +000019#include "llvm/CodeGen/StackProtector.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000020#include "llvm/IR/DataLayout.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000021#include "llvm/Pass.h"
Justin Holewinskiae556d32012-05-04 20:18:50 +000022
23namespace llvm {
24
25// actual analysis class, which is a functionpass
26struct NVPTXLowerAggrCopies : public FunctionPass {
27 static char ID;
28
29 NVPTXLowerAggrCopies() : FunctionPass(ID) {}
30
Craig Topper2865c982014-04-29 07:57:44 +000031 void getAnalysisUsage(AnalysisUsage &AU) const override {
Justin Holewinskiae556d32012-05-04 20:18:50 +000032 AU.addPreserved<MachineFunctionAnalysis>();
Chandler Carruthb81dfa62015-01-28 04:57:56 +000033 AU.addPreserved<StackProtector>();
Justin Holewinskiae556d32012-05-04 20:18:50 +000034 }
35
Craig Topper2865c982014-04-29 07:57:44 +000036 bool runOnFunction(Function &F) override;
Justin Holewinskiae556d32012-05-04 20:18:50 +000037
38 static const unsigned MaxAggrCopySize = 128;
39
Craig Topper2865c982014-04-29 07:57:44 +000040 const char *getPassName() const override {
Justin Holewinskiae556d32012-05-04 20:18:50 +000041 return "Lower aggregate copies/intrinsics into loops";
42 }
43};
44
45extern FunctionPass *createLowerAggrCopies();
46}
47
48#endif