//===-- AllocaHoisting.cpp - Hoist allocas to the entry block --*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Hoist the alloca instructions in the non-entry blocks to the entry blocks. // //===----------------------------------------------------------------------===// #include "NVPTXAllocaHoisting.h" #include "llvm/CodeGen/StackProtector.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" usingnamespacellvm; namespace { // Hoisting the alloca instructions in the non-entry blocks to the entry // block. class NVPTXAllocaHoisting : public FunctionPass { … }; } // namespace bool NVPTXAllocaHoisting::runOnFunction(Function &function) { … } char NVPTXAllocaHoisting::ID = …; namespace llvm { void initializeNVPTXAllocaHoistingPass(PassRegistry &); } INITIALIZE_PASS(…) FunctionPass *llvm::createAllocaHoisting() { … }