LLVM: lib/Target/NVPTX/NVPTXTagInvariantLoads.cpp File Reference (original) (raw)

#include "[NVPTXUtilities.h](NVPTXUtilities%5F8h%5Fsource.html)"
#include "[llvm/Analysis/ValueTracking.h](ValueTracking%5F8h%5Fsource.html)"
#include "[llvm/IR/InstIterator.h](InstIterator%5F8h%5Fsource.html)"
#include "[llvm/IR/Instructions.h](Instructions%5F8h%5Fsource.html)"
#include "[llvm/IR/Metadata.h](Metadata%5F8h%5Fsource.html)"
#include "[llvm/Support/NVPTXAddrSpace.h](NVPTXAddrSpace%5F8h%5Fsource.html)"

Go to the source code of this file.

Functions
static bool isInvariantLoad (const Instruction *I, const Value *Ptr, const bool IsKernelFn)
static void markLoadsAsInvariant (Instruction *I)
static bool tagInvariantLoads (Function &F)
INITIALIZE_PASS (NVPTXTagInvariantLoadLegacyPass, "nvptx-tag-invariant-loads", "NVPTX Tag Invariant Loads", false, false) bool NVPTXTagInvariantLoadLegacyPass

Function Documentation

INITIALIZE_PASS()

INITIALIZE_PASS ( NVPTXTagInvariantLoadLegacyPass ,
"nvptx-tag-invariant-loads" ,
"NVPTX Tag Invariant Loads" ,
false ,
false )

Definition at line 93 of file NVPTXTagInvariantLoads.cpp.

References F, runOnFunction(), and tagInvariantLoads().

isInvariantLoad()

bool isInvariantLoad ( const Instruction * I, const Value * Ptr, const bool IsKernelFn ) static

Definition at line 30 of file NVPTXTagInvariantLoads.cpp.

References A(), llvm::NVPTXAS::ADDRESS_SPACE_GLOBAL, llvm::all_of(), llvm::dyn_cast(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), llvm::getUnderlyingObjects(), I, and llvm::isParamGridConstant().

Referenced by llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), and tagInvariantLoads().

markLoadsAsInvariant()

void markLoadsAsInvariant ( Instruction * I) static

Definition at line 57 of file NVPTXTagInvariantLoads.cpp.

References llvm::MDNode::get(), and I.

Referenced by tagInvariantLoads().

tagInvariantLoads()

bool tagInvariantLoads ( Function & F) static

Definition at line 62 of file NVPTXTagInvariantLoads.cpp.

References Changed, llvm::dyn_cast(), F, I, II, instructions, isInvariantLoad(), llvm::isKernelFunction(), and markLoadsAsInvariant().

Referenced by INITIALIZE_PASS(), and llvm::NVPTXTagInvariantLoadsPass::run().