51 return "convert address space of alloca'ed memory to local";
59 "Lower Alloca",
false,
false)
65 if (skipBasicBlock(BB))
70 if (
auto allocaInst = dyn_cast<AllocaInst>(&
I)) {
79 NewASCToLocal->insertAfter(allocaInst);
80 NewASCToGeneric->insertAfter(NewASCToLocal);
82 UE = allocaInst->use_end();
89 const auto &AllocaUse = *UI++;
91 if (LI && LI->getPointerOperand() == allocaInst && !LI->isVolatile()) {
92 LI->
setOperand(LI->getPointerOperandIndex(), NewASCToGeneric);
96 if (
SI &&
SI->getPointerOperand() == allocaInst && !
SI->isVolatile()) {
97 SI->setOperand(
SI->getPointerOperandIndex(), NewASCToGeneric);
101 if (GI && GI->getPointerOperand() == allocaInst) {
102 GI->
setOperand(GI->getPointerOperandIndex(), NewASCToGeneric);
106 if (BI && BI->getOperand(0) == allocaInst) {
117 return new NVPTXLowerAlloca();
This class represents lattice values for constants.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
An instruction for reading from memory.
This class represents a conversion between pointers from one address space to another.
INITIALIZE_PASS(NVPTXLowerAlloca, "nvptx-lower-alloca", "Lower Alloca", false, false) bool NVPTXLowerAlloca
This class represents a no-op cast from one type to another.
An instruction for storing to memory.
Class to represent pointers.
use_iterator_impl< Use > use_iterator
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
LLVM Basic Block Representation.
BasicBlockPass class - This class is used to implement most local optimizations.
void initializeNVPTXLowerAllocaPass(PassRegistry &)
BasicBlockPass * createNVPTXLowerAllocaPass()
Module.h This file contains the declarations for the Module class.
void setOperand(unsigned i, Value *Val)
static bool runOnBasicBlock(MachineBasicBlock *MBB, std::vector< StringRef > &bbNames, std::vector< unsigned > &renamedInOtherBB, unsigned &basicBlockNum, unsigned &VRegGapIndex, NamedVRegCursor &NVC)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Type * getElementType() const