LLVM: lib/Target/AArch64/AArch64PromoteConstant.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "aarch64-promote-const" |
| Functions | |
|---|---|
| STATISTIC (NumPromoted, "Number of promoted constants") | |
| STATISTIC (NumPromotedUses, "Number of promoted constants uses") | |
| INITIALIZE_PASS_BEGIN (AArch64PromoteConstant, "aarch64-promote-const", "AArch64 Promote Constant Pass", false, false) INITIALIZE_PASS_END(AArch64PromoteConstant | |
| static bool | isConstantUsingVectorTy (const Type *CstTy) |
| Check if the given type uses a vector type. | |
| static bool | containsOnlyConstantData (const Constant *C) |
| static bool | shouldConvertUse (const Constant *Cst, const Instruction *Instr, unsigned OpIdx) |
| Check if the given use (Instruction + OpIdx) of Cst should be converted into a load of a global variable initialized with Cst. | |
| static bool | shouldConvertImpl (const Constant *Cst) |
| Check if the given Cst should be converted into a load of a global variable initialized with Cst. | |
| static bool | shouldConvert (Constant &C, AArch64PromoteConstant::PromotionCacheTy &PromotionCache) |
| static void | ensurePromotedGV (Function &F, Constant &C, AArch64PromoteConstant::PromotedConstant &PC) |
| Variables | |
|---|---|
| static cl::opt< bool > | Stress ("aarch64-stress-promote-const", cl::Hidden, cl::desc("Promote all vector constants")) |
| aarch64 promote | const |
| aarch64 promote AArch64 Promote Constant | Pass |
| aarch64 promote AArch64 Promote Constant | false |
◆ DEBUG_TYPE
#define DEBUG_TYPE "aarch64-promote-const"
◆ containsOnlyConstantData()
◆ ensurePromotedGV()
| void ensurePromotedGV ( Function & F, Constant & C, AArch64PromoteConstant::PromotedConstant & PC ) | static |
|---|
◆ INITIALIZE_PASS_BEGIN()
| INITIALIZE_PASS_BEGIN | ( | AArch64PromoteConstant | , |
|---|---|---|---|
| "aarch64-promote-const" | , | ||
| "AArch64 Promote Constant Pass" | , | ||
| false | , | ||
| false | ) |
◆ isConstantUsingVectorTy()
| bool isConstantUsingVectorTy ( const Type * CstTy) | static |
|---|
◆ shouldConvert()
◆ shouldConvertImpl()
Check if the given Cst should be converted into a load of a global variable initialized with Cst.
A constant should be converted if it is likely that the materialization of the constant will be tricky. Thus, we give up on zero or undef values.
Currently, accept only vector related types. Also we give up on all simple vector type to keep the existing behavior. Otherwise, we should push here all the check of the lowering of BUILD_VECTOR. By giving up, we lose the potential benefit of merging constant via global merge and the fact that the same constant is stored only once with this method (versus, as many function that uses the constant for the regular approach, even for float). Again, the simplest solution would be to promote every constant and rematerialize them when they are actually cheap to create.
Definition at line 334 of file AArch64PromoteConstant.cpp.
References llvm::Value::getType(), llvm::isa(), isConstantUsingVectorTy(), llvm::Type::isScalableTy(), llvm::Type::isVectorTy(), llvm::Constant::isZeroValue(), and Stress.
Referenced by shouldConvert().
◆ shouldConvertUse()
◆ STATISTIC() [1/2]
| STATISTIC | ( | NumPromoted | , |
|---|---|---|---|
| "Number of promoted constants" | ) |
◆ STATISTIC() [2/2]
| STATISTIC | ( | NumPromotedUses | , |
|---|---|---|---|
| "Number of promoted constants uses" | ) |
◆ const
Definition at line 228 of file AArch64PromoteConstant.cpp.
Referenced by addInstToMergeableList(), llvm::User::AllocInfo::AllocInfo(), llvm::AMDGPUTTIImpl::AMDGPUTTIImpl(), llvm::object::ArchiveMemberHeader::ArchiveMemberHeader(), llvm::ARCTTIImpl::ARCTTIImpl(), llvm::object::ELFFile< ELF32LE >::base(), llvm::object::BigArchiveMemberHeader::BigArchiveMemberHeader(), blockPrologueInterferes(), llvm::orc::BloomFilter::BloomFilter(), canBeFeederToNewValueJump(), llvm::BTF::ArrayType::classof(), llvm::BTF::Enum64Type::classof(), llvm::BTF::EnumType::classof(), llvm::BTF::StructType::classof(), llvm::Instruction::classof(), llvm::createAMDGPULowerModuleLDSLegacyPass(), llvm::createCFGSimplificationPass(), llvm::IRBuilderBase::CreateGlobalStringPtr(), llvm::codeview::CVRecord< TypeLeafKind >::CVRecord(), llvm::DataExtractor::DataExtractor(), decodeVersionImm(), DecodeVGPR_16RegisterClass(), llvm::sandboxir::CatchSwitchAddHandler::dump(), llvm::sandboxir::GenericSetter< GetterFn, SetterFn >::dump(), llvm::sandboxir::GenericSetterWithIdx< GetterFn, SetterFn >::dump(), llvm::sandboxir::dumpOS(), llvm::DWARFDataExtractorBase< Relocator >::DWARFDataExtractorBase(), llvm::object::DynamicRelocRef::DynamicRelocRef(), llvm::object::ELFFile< ELF32LE >::ELFFile(), llvm::ExitOnError::ExitOnError(), findCalledFunction(), FindDominatedInstruction(), findVCMPToFoldIntoVPST(), fixupReg(), llvm::GCNTTIImpl::GCNTTIImpl(), generateEndPgm(), llvm::DbgVariable::get(), llvm::SPIRVModuleAnalysis::getAnalysisUsage(), llvm::object::Elf_Verdef_Impl< ELFType< E, Is64 > >::getAux(), llvm::GenericCycle< ContextT >::getCyclePredecessor(), llvm::GenericCycle< ContextT >::getCyclePreheader(), llvm::Module::getFunctionList(), llvm::cas::builtin::BuiltinCASContext::getHashSchemaIdentifier(), llvm::Function::getIntrinsicID(), getLocCookie(), getMemTarget(), llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >::getNumOfIRInstrs(), llvm::sandboxir::UnreachableInst::getNumOfIRInstrs(), llvm::logicalview::LVCompare::getPassTable(), getRegisterSize(), getRegLiveThroughMask(), getRegOpRC(), llvm::BasicBlock::getTerminator(), llvm::ListInit::getValues(), handleUse(), llvm::lsp::JSONTransportInputOverFile::hasError(), llvm::HexagonPacketizerList::HexagonPacketizerList(), llvm::HexagonTargetLowering::HexagonTargetLowering(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), INITIALIZE_PASS(), llvm::InitLLVM::InitLLVM(), llvm::lsp::JSONTransportInputOverFile::isEndOfInput(), isIntImmediate(), isLegalMaskCompare(), isLiveIntoMBB(), isMoveInstr(), llvm::Function::llvm::ilist_node_with_parent< llvm::BasicBlock, llvm::Function >, llvm::BasicBlock::LLVM_DEPRECATED(), llvm::BasicBlock::LLVM_DEPRECATED(), llvm::Instruction::LLVM_DEPRECATED(), llvm::support::endian::LLVM_DEPRECATED(), llvm::Type::LLVM_DEPRECATED(), LLVMRemarkParserCreateYAML(), LLVMRemarkStringGetData(), llvm::LoadStoreOpt::LoadStoreOpt(), llvm::LoadStoreOpt::LoadStoreOpt(), llvm::Localizer::Localizer(), llvm::Localizer::Localizer(), llvm::MachinePointerInfo::MachinePointerInfo(), DIAErrorCategory::name(), llvm::json::ObjectKey::ObjectKey(), llvm::operator<<(), llvm::operator<<(), llvm::operator<<(), llvm::sandboxir::EraseFromParent::operator<<, llvm::object::ELFFile< ELF32LE >::operator=(), llvm::orc::BloomFilter::operator=(), llvm::operator==(), llvm::vfs::output_category(), llvm::R600TTIImpl::R600TTIImpl(), llvm::RawInstrProfReader< uint32_t >::RawInstrProfReader(), restoreSSA(), llvm::HexagonDAGToDAGISel::SelectIndexedLoad(), llvm::detail::StringMapEntryMatcherImpl< StringMapEntryT >::StringMapEntryMatcherImpl(), llvm::SystemZPostRASchedStrategy::SystemZPostRASchedStrategy(), llvm::object::ELFObjectFile< ELF32LE >::toSectionRef(), TrackDefUses(), llvm::unique_function< R(P...) const >::unique_function(), updateBranches(), llvm::sandboxir::Argument::verify(), llvm::sandboxir::Function::verify(), llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >::verify(), llvm::sandboxir::verify(), and wrap().
◆ false
aarch64 promote AArch64 Promote Constant false
◆ Pass
◆ Stress
| cl::opt< bool > Stress("aarch64-stress-promote-const", cl::Hidden, cl::desc("Promote all vector constants")) ( "aarch64-stress-promote-const" , cl::Hidden , cl::desc("Promote all vector constants") ) | static |
|---|