LLVM API Documentation

NVPTXLowerAggrCopies.h
Go to the documentation of this file.
00001 //===-- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h ------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the declaration of the NVIDIA specific lowering of
00011 // aggregate copies
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
00016 #define LLVM_LIB_TARGET_NVPTX_NVPTXLOWERAGGRCOPIES_H
00017 
00018 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
00019 #include "llvm/IR/DataLayout.h"
00020 #include "llvm/Pass.h"
00021 
00022 namespace llvm {
00023 
00024 // actual analysis class, which is a functionpass
00025 struct NVPTXLowerAggrCopies : public FunctionPass {
00026   static char ID;
00027 
00028   NVPTXLowerAggrCopies() : FunctionPass(ID) {}
00029 
00030   void getAnalysisUsage(AnalysisUsage &AU) const override {
00031     AU.addRequired<DataLayoutPass>();
00032     AU.addPreserved("stack-protector");
00033     AU.addPreserved<MachineFunctionAnalysis>();
00034   }
00035 
00036   bool runOnFunction(Function &F) override;
00037 
00038   static const unsigned MaxAggrCopySize = 128;
00039 
00040   const char *getPassName() const override {
00041     return "Lower aggregate copies/intrinsics into loops";
00042   }
00043 };
00044 
00045 extern FunctionPass *createLowerAggrCopies();
00046 }
00047 
00048 #endif