LLVM 17.0.0git
Namespaces | Macros | Functions | Variables
NVVMReflect.cpp File Reference
#include "NVPTX.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Type.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include <sstream>
#include <string>
Include dependency graph for NVVMReflect.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define NVVM_REFLECT_FUNCTION   "__nvvm_reflect"
 
#define NVVM_REFLECT_OCL_FUNCTION   "__nvvm_reflect_ocl"
 
#define DEBUG_TYPE   "nvptx-reflect"
 

Functions

void llvm::initializeNVVMReflectPass (PassRegistry &)
 
 INITIALIZE_PASS (NVVMReflect, "nvvm-reflect", "Replace occurrences of __nvvm_reflect() calls with 0/1", false, false) static bool runNVVMReflect(Function &F
 
 if (F.getName()==NVVM_REFLECT_FUNCTION||F.getName()==NVVM_REFLECT_OCL_FUNCTION)
 
 for (Instruction &I :instructions(F))
 
 for (Instruction *I :ToRemove) I -> eraseFromParent()
 
return ToRemove size () > 0
 

Variables

static cl::opt< boolNVVMReflectEnabled ("nvvm-reflect-enable", cl::init(true), cl::Hidden, cl::desc("NVVM reflection, enabled by default"))
 
unsigned SmVersion
 
SmallVector< Instruction *, 4 > ToRemove
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "nvptx-reflect"

Definition at line 47 of file NVVMReflect.cpp.

◆ NVVM_REFLECT_FUNCTION

#define NVVM_REFLECT_FUNCTION   "__nvvm_reflect"

Definition at line 42 of file NVVMReflect.cpp.

◆ NVVM_REFLECT_OCL_FUNCTION

#define NVVM_REFLECT_OCL_FUNCTION   "__nvvm_reflect_ocl"

Definition at line 43 of file NVVMReflect.cpp.

Function Documentation

◆ for() [1/2]

for ( Instruction &I   :instructionsF)

◆ for() [2/2]

for ( Instruction *I :ToRemove  ) -> eraseFromParent()

◆ if()

if ( F.  getName() = NVVM_REFLECT_FUNCTION || F.getName() == NVVM_REFLECT_OCL_FUNCTION)

Definition at line 82 of file NVVMReflect.cpp.

References assert(), and F.

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( NVVMReflect  ,
"nvvm-reflect"  ,
"Replace occurrences of __nvvm_reflect() calls with 0/1"  ,
false  ,
false   
) &

◆ size()

return ToRemove size ( )

Referenced by llvm::pdb::NativeSession::addressForRVA(), llvm::User::allocHungoffUses(), Analyze_CC_Sparc64_Full(), llvm::SmallVectorImpl< T >::append(), llvm::SmallString< InternalLen >::append(), llvm::CanonicalLoopInfo::assertOK(), llvm::SmallVectorImpl< T >::assign(), llvm::MutableArrayRef< T >::back(), llvm::ValueEnumerator::computeBitsRequiredForTypeIndicies(), llvm::LegacyLegalizerInfo::computeTables(), llvm::gsym::ObjectFileTransformer::convert(), llvm::convertUTF8Sequence(), llvm::orc::EPCEHFrameRegistrar::Create(), llvm::LTOModule::createFromOpenFile(), llvm::mca::InstrBuilder::createInstruction(), llvm::orc::createJITLoaderGDBRegistrar(), llvm::AArch64_AM::decodeLogicalImmediate(), DecodeVLD1DupInstruction(), DecodeVLD1LN(), DecodeVLD2DupInstruction(), DecodeVLD2LN(), DecodeVLD3LN(), DecodeVLD4DupInstruction(), DecodeVLD4LN(), DecodeVLDST2Instruction(), DecodeVLDST3Instruction(), DecodeVLDST4Instruction(), DecodeVSHLMaxInstruction(), DecodeVST1LN(), DecodeVST2LN(), DecodeVST3LN(), DecodeVST4LN(), llvm::CSKYFrameLowering::determineCalleeSaves(), llvm::ArrayRef< T >::drop_back(), llvm::MutableArrayRef< T >::drop_back(), llvm::StringRef::drop_back(), llvm::ArrayRef< T >::drop_front(), llvm::MutableArrayRef< T >::drop_front(), llvm::StringRef::drop_front(), llvm::MipsSEFrameLowering::emitEpilogue(), emitFDESymbol(), EmitPersonality(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::EnumeratedArray< ValueType, Enumeration, LargestEnum, IndexType, Size >::empty(), llvm::EnumeratedArray< ValueType, Enumeration, LargestEnum, IndexType, Size >::end(), llvm::MutableArrayRef< T >::end(), enlarge(), llvm::LegalizerHelper::fewerElementsVectorMultiEltType(), llvm::StringRef::find_if(), llvm::FindInsertedValue(), llvm::DWARFUnitVector::finishedInfoUnits(), llvm::lto::generateModulesOrdering(), llvm::AAPotentialConstantValues::getAssumedConstant(), getDataAlignmentFactor(), llvm::LTOModule::getDependentLibrary(), llvm::RuntimeDyldCOFF::getDLLImportOffset(), llvm::MCLOHDirective::getEmitSize(), llvm::DWARFUnitVector::getNumInfoUnits(), llvm::DWARFUnitVector::getNumTypesUnits(), llvm::DWARFUnitVector::getNumUnits(), llvm::cl::generic_parser_base::getOptionWidth(), llvm::cl::list< DataType, StorageClass, ParserClass >::getPosition(), llvm::cl::bits< DataType, Storage, ParserClass >::getPosition(), llvm::NVPTXTargetLowering::getPrototype(), llvm::X86TargetLowering::getSingleConstraintMatchWeight(), llvm::SIRegisterInfo::getSubRegFromChannel(), getSystemRegistryString(), llvm::slpvectorizer::BoUpSLP::VLOperands::getVL(), llvm::SmallVectorBase< Size_T >::grow_pod(), llvm::TrigramIndex::insert(), llvm::SmallVectorImpl< T >::insert(), llvm::DWARFFormValue::isFormClass(), llvm::ShuffleVectorInst::isReplicationMask(), llvm::isSafeToUnrollAndJam(), llvm::AArch64_AM::isValidDecodeLogicalImmediate(), loadTestingFormat(), LowerCMP_SWAP(), llvm::HexagonTargetLowering::LowerCONCAT_VECTORS(), llvm::SPIRVCallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArgumentsKernel(), llvm::IntervalMapImpl::Path::moveRight(), operator new(), llvm::SmallString< InternalLen >::operator std::string(), llvm::MachO::ArchitectureSet::operator std::string(), llvm::StringRef::operator std::string_view(), llvm::operator+=(), llvm::SmallVectorImpl< T >::operator=(), llvm::SmallVectorImpl< T >::operator==(), llvm::MutableArrayRef< T >::operator[](), llvm::ELFAttributeParser::parseSubsection(), llvm::R600SchedStrategy::pickNode(), llvm::SmallVectorImpl< T >::pop_back_n(), llvm::AArch64InstPrinter::printGPRSeqPairsClassOperand(), llvm::promoteScalarArgumentSize(), readImmediate(), readOpcodeRegister(), ReadSignature(), llvm::slpvectorizer::BoUpSLP::VLOperands::reorder(), llvm::RegBankSelect::repairReg(), llvm::LoopBase< BlockT, LoopT >::reserveBlocks(), llvm::SmallVectorImpl< T >::resize(), llvm::AArch64_AM::ror(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), llvm::SplitEditor::selectIntv(), separateNestedLoop(), llvm::LegacyLegalizerInfo::setAction(), llvm::ARMFunctionInfo::setArgumentStackSize(), llvm::M68kMachineFunctionInfo::setArgumentStackSize(), llvm::X86MachineFunctionInfo::setArgumentStackSize(), llvm::LegacyLegalizerInfo::setLegalizeScalarToDifferentSizeStrategy(), llvm::LegacyLegalizerInfo::setLegalizeVectorElementToDifferentSizeStrategy(), llvm::PPCFunctionInfo::setMinReservedArea(), llvm::DIELoc::setSize(), llvm::DIEBlock::setSize(), llvm::PPCFunctionInfo::setTailCallSPDelta(), llvm::InlineAsmIdentifierInfo::setVar(), llvm::AAMDNodes::shiftTBAAStruct(), llvm::SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >::shrink_and_clear(), llvm::shuffle(), llvm::SIRegisterInfo::SIRegisterInfo(), llvm::orc::shared::SPSSerializationTraits< SPSTuple< SPSTagTs... >, std::tuple< Ts... > >::size(), llvm::DWARFFormValue::skipValue(), llvm::ArrayRef< T >::slice(), llvm::MutableArrayRef< T >::slice(), llvm::SmallString< InternalLen >::str(), llvm::SmallVectorImpl< T >::swap(), llvm::ArrayRef< T >::take_back(), llvm::MutableArrayRef< T >::take_back(), llvm::StringRef::take_back(), llvm::ArrayRef< T >::take_front(), llvm::MutableArrayRef< T >::take_front(), llvm::StringRef::take_front(), llvm::SmallVectorImpl< T >::truncate(), llvm::orc::DLLImportDefinitionGenerator::tryToGenerate(), llvm::objcopy::wasm::Writer::write(), and llvm::write32AArch64Ldr().

Variable Documentation

◆ NVVMReflectEnabled

cl::opt< bool > NVVMReflectEnabled("nvvm-reflect-enable", cl::init(true), cl::Hidden, cl::desc("NVVM reflection, enabled by default")) ( "nvvm-reflect-enable"  ,
cl::init(true ,
cl::Hidden  ,
cl::desc("NVVM reflection, enabled by default")   
)
static

◆ SmVersion

unsigned SmVersion

◆ ToRemove

SmallVector<Instruction *, 4> ToRemove

Definition at line 90 of file NVVMReflect.cpp.

Referenced by for().