|
LLVM 24.0.0git
|
#include "AArch64.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constant.h"#include "llvm/IR/Constants.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include <cassert>#include <utility>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 |
| #define DEBUG_TYPE "aarch64-promote-const" |
Definition at line 51 of file AArch64PromoteConstant.cpp.
Definition at line 250 of file AArch64PromoteConstant.cpp.
References llvm::all_of(), llvm::CallingConv::C, and llvm::isa().
|
static |
Definition at line 482 of file AArch64PromoteConstant.cpp.
References assert(), llvm::CallingConv::C, llvm::dbgs(), F, llvm::GlobalValue::InternalLinkage, LLVM_DEBUG, llvm::GlobalValue::NotThreadLocal, llvm::Value::print(), and llvm::GlobalVariable::setInitializer().
| INITIALIZE_PASS_BEGIN | ( | AArch64PromoteConstant | , |
| "aarch64-promote-const" | , | ||
| "AArch64 Promote Constant Pass" | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_DEPENDENCY.
Check if the given type uses a vector type.
Definition at line 235 of file AArch64PromoteConstant.cpp.
References llvm::Type::getArrayElementType(), llvm::Type::getStructElementType(), llvm::Type::getStructNumElements(), llvm::Type::isArrayTy(), isConstantUsingVectorTy(), llvm::Type::isStructTy(), and llvm::Type::isVectorTy().
Referenced by isConstantUsingVectorTy(), and shouldConvertImpl().
|
static |
Definition at line 361 of file AArch64PromoteConstant.cpp.
References llvm::CallingConv::C, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), and 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.
Definition at line 333 of file AArch64PromoteConstant.cpp.
References llvm::Value::getType(), llvm::isa(), isConstantUsingVectorTy(), llvm::Constant::isNullValue(), llvm::Type::isScalableTy(), llvm::Type::isVectorTy(), and Stress.
Referenced by shouldConvert().
Check if the given use (Instruction + OpIdx) of Cst should be converted into a load of a global variable initialized with Cst.
A use should be converted if it is legal to do so. For instance, it is not legal to turn the mask operand of a shuffle vector into a load of a global variable.
Definition at line 267 of file AArch64PromoteConstant.cpp.
References llvm::dyn_cast(), llvm::isa(), llvm::CallBase::isInlineAsm(), and OpIdx.
| STATISTIC | ( | NumPromoted | , |
| "Number of promoted constants" | ) |
| STATISTIC | ( | NumPromotedUses | , |
| "Number of promoted constants uses" | ) |
| aarch64 promote const |
Definition at line 227 of file AArch64PromoteConstant.cpp.
Referenced by llvm::AArch64PostLegalizerCombinerPass::AArch64PostLegalizerCombinerPass(), 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::createAMDGPULowerModuleLDSLegacyPass(), llvm::createCFGSimplificationPass(), llvm::codeview::CVRecord< TypeLeafKind >::CVRecord(), llvm::DataExtractor::DataExtractor(), decodeVersionImm(), DecodeVGPR_16RegisterClass(), llvm::DivergencePropagator< ContextT >::DivergencePropagator(), llvm::sandboxir::CatchSwitchAddHandler::dump(), llvm::sandboxir::GenericSetter< GetterFn, SetterFn >::dump(), llvm::sandboxir::GenericSetterWithIdx< GetterFn, SetterFn >::dump(), llvm::sandboxir::dumpOS(), llvm::object::DynamicRelocRef::DynamicRelocRef(), llvm::object::ELFFile< ELF32LE >::ELFFile(), llvm::ScalarEvolution::ExitLimit::ExitLimit(), llvm::ExitOnError::ExitOnError(), findCalledFunction(), FindDominatedInstruction(), findVCMPToFoldIntoVPST(), fixupReg(), llvm::GCNTTIImpl::GCNTTIImpl(), generateEndPgm(), llvm::DbgVariable::get(), llvm::object::Elf_Verdef_Impl< ELFType< E, Is64 > >::getAux(), 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::BasicBlock::getTerminatorOrNull(), llvm::ListInit::getValues(), handleUse(), llvm::lsp::JSONTransportInputOverFile::hasError(), llvm::BasicBlock::hasTerminator(), 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(), INITIALIZE_PASS(), llvm::InitLLVM::InitLLVM(), insertCSRSaves(), llvm::lsp::JSONTransportInputOverFile::isEndOfInput(), isLegalMaskCompare(), isMoveInstr(), llvm::Function::llvm::ilist_node_with_parent< llvm::BasicBlock, llvm::Function >, LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), LLVM_ATTRIBUTE_C_DEPRECATED(), llvm::BasicBlock::LLVM_DEPRECATED(), llvm::BasicBlock::LLVM_DEPRECATED(), llvm::Instruction::LLVM_DEPRECATED(), llvm::support::endian::LLVM_DEPRECATED(), llvm::Type::LLVM_DEPRECATED(), LLVMConstByteOfStringAndSize(), LLVMConstIntOfString(), LLVMConstIntOfStringAndSize(), LLVMConstRealOfStringAndSize(), 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::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(), setPrefetchTargets(), llvm::detail::StringMapEntryMatcherImpl< StringMapEntryT >::StringMapEntryMatcherImpl(), llvm::SystemZPostRASchedStrategy::SystemZPostRASchedStrategy(), llvm::object::ELFObjectFile< ELF32LE >::toSectionRef(), TrackDefUses(), llvm::unique_function< R(P...) const >::unique_function(), updateBranches(), llvm::DenseMapBase< DenseMap, KeyT, ValueT, KeyInfoT, BucketT >::ValueHandleBase, llvm::sandboxir::Argument::verify(), llvm::sandboxir::Function::verify(), llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >::verify(), llvm::sandboxir::verify(), and wrap().
| aarch64 promote AArch64 Promote Constant false |
Definition at line 228 of file AArch64PromoteConstant.cpp.
Definition at line 228 of file AArch64PromoteConstant.cpp.