|
LLVM 24.0.0git
|
#include "llvm/IR/AutoUpgrade.h"#include "IROptions.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/BinaryFormat/Dwarf.h"#include "llvm/IR/AttributeMask.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/CallingConv.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/DiagnosticInfo.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/InstVisitor.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/IntrinsicsAArch64.h"#include "llvm/IR/IntrinsicsAMDGPU.h"#include "llvm/IR/IntrinsicsARM.h"#include "llvm/IR/IntrinsicsNVPTX.h"#include "llvm/IR/IntrinsicsRISCV.h"#include "llvm/IR/IntrinsicsWebAssembly.h"#include "llvm/IR/IntrinsicsX86.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Metadata.h"#include "llvm/IR/Module.h"#include "llvm/IR/NVVMIntrinsicUtils.h"#include "llvm/IR/Value.h"#include "llvm/IR/Verifier.h"#include "llvm/Support/AMDGPUAddrSpace.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/NVPTXAddrSpace.h"#include "llvm/Support/NVVMAttributes.h"#include "llvm/Support/Regex.h"#include "llvm/Support/TimeProfiler.h"#include "llvm/TargetParser/Triple.h"#include <cstdint>#include <cstring>#include <numeric>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "auto-upgrade" |
| #define | NVVM_TMA_G2S_MODES(M) |
| #define | G2S_ID(ID_SUFFIX, NAME) |
| #define | G2S_CTA_ID(ID_SUFFIX, NAME) |
| #define | G2S_CLUSTER_CASE(ID_SUFFIX, NAME) |
| #define | G2S_CTA_CASE(ID_SUFFIX, NAME) |
Variables | |
| static constexpr Intrinsic::ID | NVVMFAddIIDs [2][3] |
| static constexpr Intrinsic::ID | NVVMFMulIIDs [2][3] |
| static constexpr Intrinsic::ID | NVVMFMAIIDs [2][3] |
| #define DEBUG_TYPE "auto-upgrade" |
Definition at line 66 of file AutoUpgrade.cpp.
| #define G2S_CLUSTER_CASE | ( | ID_SUFFIX, | |
| NAME ) |
Referenced by llvm::UpgradeIntrinsicCall().
| #define G2S_CTA_CASE | ( | ID_SUFFIX, | |
| NAME ) |
Referenced by llvm::UpgradeIntrinsicCall().
| #define G2S_CTA_ID | ( | ID_SUFFIX, | |
| NAME ) |
Referenced by shouldUpgradeNVPTXTMAG2SCTAIntrinsics().
| #define G2S_ID | ( | ID_SUFFIX, | |
| NAME ) |
Referenced by shouldUpgradeNVPTXTMAG2SIntrinsics().
| #define NVVM_TMA_G2S_MODES | ( | M | ) |
Definition at line 1195 of file AutoUpgrade.cpp.
Referenced by shouldUpgradeNVPTXTMAG2SCTAIntrinsics(), shouldUpgradeNVPTXTMAG2SIntrinsics(), and llvm::UpgradeIntrinsicCall().
Definition at line 2991 of file AutoUpgrade.cpp.
References C(), llvm::cast(), llvm::dyn_cast(), llvm::Constant::getNullValue(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall(), upgradeMaskedCompare(), and upgradeX86IntrinsicCall().
Definition at line 1599 of file AutoUpgrade.cpp.
Referenced by upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().
Definition at line 7849 of file AutoUpgrade.cpp.
References A(), llvm::dbgs(), F, and LLVM_DEBUG.
Referenced by llvm::copyModuleAttrToFunctions().
|
static |
Definition at line 1689 of file AutoUpgrade.cpp.
References llvm::CastInst::castIsValid(), and llvm::Type::getHalfTy().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 7871 of file AutoUpgrade.cpp.
References llvm::dbgs(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, and LLVM_DEBUG.
Referenced by llvm::copyModuleAttrToFunctions().
|
static |
Definition at line 2677 of file AutoUpgrade.cpp.
References C(), llvm::dyn_cast(), llvm::FixedVectorType::get(), and uint64_t.
Referenced by upgradeX86IntrinsicCall().
Definition at line 2665 of file AutoUpgrade.cpp.
References C(), llvm::cast(), llvm::dyn_cast(), llvm::Value::getType(), and getX86MaskVec().
Referenced by upgradeAbs(), upgradeAVX512MaskToSelect(), upgradePMULDQ(), upgradeX86ALIGNIntrinsics(), upgradeX86BinaryIntrinsics(), upgradeX86ConcatShift(), upgradeX86IntrinsicCall(), upgradeX86MaskedShift(), upgradeX86Rotate(), and upgradeX86VPERMT2Intrinsics().
|
static |
Definition at line 1710 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getAllDefaultArgValues(), and llvm::Intrinsic::isSignatureValid().
Referenced by upgradeIntrinsicWithDefaultArgs().
|
static |
Definition at line 1642 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Default(), and llvm::StringSwitch< T, R >::StartsWith().
Referenced by shouldUpgradeVPIntrinsic(), and upgradeVPIntrinsicCall().
Definition at line 1605 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Default(), and llvm::StringSwitch< T, R >::StartsWith().
Referenced by shouldUpgradeVPIntrinsic(), and upgradeVPIntrinsicCall().
Definition at line 6957 of file AutoUpgrade.cpp.
References llvm::dyn_cast_or_null().
Referenced by upgradePtrauthInitFiniArrays().
Definition at line 1340 of file AutoUpgrade.cpp.
References llvm::nvvm::ADD, llvm::nvvm::AND, llvm::StringSwitch< T, R >::Case(), llvm::nvvm::DEC, llvm::StringSwitch< T, R >::Default(), llvm::nvvm::INC, llvm::nvvm::MAX, llvm::nvvm::MIN, llvm::nvvm::OR, and llvm::nvvm::XOR.
Referenced by shouldUpgradeNVPTXTMAReductionIntrinsics(), and llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1559 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringRef::consume_front(), llvm::StringSwitch< T, R >::Default(), llvm::StringRef::empty(), isValidLegacyNVVMFPArithIntrinsic(), llvm::NearestTiesToEven, llvm::Intrinsic::not_intrinsic, llvm::TowardNegative, llvm::TowardPositive, and llvm::TowardZero.
Referenced by upgradeIntrinsicFunction1(), and upgradeNVVMFPArithCall().
|
static |
Return the replacement tags if T still uses a removed two-operand form.
Definition at line 7973 of file AutoUpgrade.cpp.
References llvm::dyn_cast_or_null(), llvm::findBooleanLoopTags(), llvm::mdconst::hasa(), and T.
Referenced by isOldLoopArgument(), llvm::upgradeInstructionLoopAttachment(), and upgradeLoopArgument().
Definition at line 5735 of file AutoUpgrade.cpp.
References llvm::CmpInst::BAD_FCMP_PREDICATE, llvm::StringSwitch< T, R >::Case(), llvm::cast(), llvm::StringSwitch< T, R >::Default(), llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, and llvm::isa().
Referenced by upgradeVPIntrinsicCall().
Definition at line 5717 of file AutoUpgrade.cpp.
References llvm::CmpInst::BAD_ICMP_PREDICATE, llvm::StringSwitch< T, R >::Case(), llvm::cast(), llvm::StringSwitch< T, R >::Default(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, and llvm::isa().
Referenced by upgradeVPIntrinsicCall().
Definition at line 2645 of file AutoUpgrade.cpp.
References llvm::ArrayRef(), assert(), llvm::cast(), llvm::FixedVectorType::get(), and llvm::isPowerOf2_32().
Referenced by applyX86MaskOn1BitsVec(), emitX86Select(), llvm::UpgradeIntrinsicCall(), upgradeMaskedLoad(), upgradeMaskedStore(), upgradeMaskToInt(), and upgradeX86IntrinsicCall().
|
static |
Definition at line 1504 of file AutoUpgrade.cpp.
References E(), F, llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarType(), llvm::Intrinsic::getType(), I, and llvm::Type::isIntegerTy().
Referenced by upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().
Definition at line 7990 of file AutoUpgrade.cpp.
References llvm::dyn_cast_or_null(), getOldBooleanLoopTags(), and T.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 1542 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::Default, NVVMFMAIIDs, and NVVMFMulIIDs.
Referenced by getNVVMFPArithUpgrade().
Definition at line 7044 of file AutoUpgrade.cpp.
Referenced by upgradeSingleNVVMAnnotation().
|
static |
Build the single-operand node that replaces a boolean operand: nonzero selects the enable tag, zero the disable tag.
Definition at line 7982 of file AutoUpgrade.cpp.
References C(), llvm::BooleanLoopTags::Disable, Enable, llvm::BooleanLoopTags::Enable, llvm::mdconst::extract(), llvm::MDString::get(), and llvm::MDTuple::get().
Referenced by upgradeLoopArgument().
|
static |
Rebuild the alias scope or domain Old with Ops, keeping its identity: a self reference has to point at the replacement, and a distinct node must not be uniqued.
The first operand of both a scope and a domain is its name, which is either a string or a self reference.
Definition at line 6834 of file AutoUpgrade.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::MDNode::getDistinct(), and llvm::MDNode::isDistinct().
Referenced by upgradeAliasScope(), and upgradeAliasScopeDomain().
|
static |
Definition at line 68 of file AutoUpgrade.cpp.
References llvm::Value::getName(), and llvm::Value::setName().
Referenced by upgradeArmOrAarch64IntrinsicFunction(), upgradeIntrinsicFunction1(), upgradeIntrinsicWithDefaultArgs(), upgradeNVVMIntrinsicCall(), upgradePTESTIntrinsic(), upgradeX86BF16DPIntrinsic(), upgradeX86BF16Intrinsic(), upgradeX86IntrinsicFunction(), upgradeX86IntrinsicsWith8BitMask(), upgradeX86MaskedFPCompare(), upgradeX86MultiplyAddBytes(), and upgradeX86MultiplyAddWords().
Definition at line 72 of file AutoUpgrade.cpp.
References llvm::errs(), llvm::Value::print(), and llvm::reportFatalUsageError().
Referenced by upgradeX86IntrinsicCall().
Definition at line 7837 of file AutoUpgrade.cpp.
References llvm::dbgs(), F, and LLVM_DEBUG.
Referenced by llvm::copyModuleAttrToFunctions().
|
static |
Definition at line 1446 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().
|
static |
Definition at line 1296 of file AutoUpgrade.cpp.
References F, llvm::Type::isIntegerTy(), llvm::Intrinsic::not_intrinsic, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1324 of file AutoUpgrade.cpp.
References F, and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1592 of file AutoUpgrade.cpp.
References llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1387 of file AutoUpgrade.cpp.
References llvm::NVPTXAS::ADDRESS_SPACE_SHARED, llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), F, and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1436 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), F, and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1411 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), F, and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1263 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Default(), F, G2S_CTA_ID, llvm::Intrinsic::not_intrinsic, and NVVM_TMA_G2S_MODES.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1220 of file AutoUpgrade.cpp.
References assert(), llvm::StringSwitch< T, R >::Default(), F, G2S_ID, llvm::Type::isIntegerTy(), llvm::Intrinsic::not_intrinsic, NVVM_TMA_G2S_MODES, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1353 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), getNVPTXTMAReductionOp(), and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1374 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getType(), and llvm::Intrinsic::not_intrinsic.
Referenced by upgradeIntrinsicFunction1().
Definition at line 1685 of file AutoUpgrade.cpp.
References getFunctionalIntrinsicIDForVP(), and getFunctionalOpcodeForVP().
Referenced by llvm::UpgradeIntrinsicCall(), and upgradeIntrinsicFunction1().
Definition at line 180 of file AutoUpgrade.cpp.
References F.
Referenced by upgradeX86IntrinsicFunction().
Helper to unwrap Metadata MetadataAsValue operands, such as the Value field.
Definition at line 5629 of file AutoUpgrade.cpp.
References llvm::dyn_cast(), and llvm::CallBase::getArgOperand().
Referenced by upgradeDbgIntrinsicToDbgRecord().
Helper to unwrap intrinsic call MetadataAsValue operands.
Return as a plain MDNode, as it's the verifier's job to check these are the correct types later.
Definition at line 5617 of file AutoUpgrade.cpp.
References llvm::dyn_cast(), llvm::dyn_cast_if_present(), and llvm::CallBase::getArgOperand().
Referenced by upgradeDbgIntrinsicToDbgRecord().
|
static |
Definition at line 5254 of file AutoUpgrade.cpp.
References llvm::CallBase::args(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::StringSwitch< T, R >::Case(), llvm::dbgs(), llvm::StringSwitch< T, R >::Default(), llvm::SmallVectorTemplateCommon< T, typename >::end(), F, llvm::ConstantAggregateZero::get(), llvm::FixedVectorType::get(), llvm::ScalableVectorType::get(), llvm::Type::getBFloatTy(), llvm::Type::getFloatTy(), llvm::Type::getHalfTy(), llvm::Type::getInt16Ty(), llvm::Value::getName(), llvm::User::getOperand(), getType(), llvm::Value::getType(), llvm_unreachable, llvm::Intrinsic::not_intrinsic, and llvm::Trunc.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 2951 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), emitX86Select(), llvm::CallBase::getArgOperand(), and llvm::Value::getType().
Referenced by upgradeX86IntrinsicCall().
Definition at line 6871 of file AutoUpgrade.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::cast(), llvm::isa(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), rebuildScopeOrDomainNode(), and upgradeAliasScopeDomain().
Referenced by llvm::UpgradeAliasScopeList().
|
static |
Definition at line 6847 of file AutoUpgrade.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::ConstantAsMetadata::get(), llvm::ConstantInt::getFalse(), llvm::mdconst::hasa(), and rebuildScopeOrDomainNode().
Referenced by upgradeAliasScope().
|
static |
Definition at line 5414 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::CallBase::args(), assert(), llvm::cast(), llvm::Instruction::copyMetadata(), llvm::MDBuilder::createRange(), llvm::dyn_cast(), E(), F, llvm::AtomicRMWInst::FAdd, llvm::AMDGPUAS::FLAT_ADDRESS, llvm::AtomicRMWInst::FMax, llvm::AtomicRMWInst::FMin, llvm::MDNode::get(), llvm::VectorType::get(), llvm::CallBase::getArgOperand(), llvm::CallBase::getAttributes(), llvm::Type::getBFloatTy(), llvm::CallBase::getCallingConv(), llvm::User::getNumOperands(), llvm::CallBase::getOperandBundlesAsDefs(), llvm::Intrinsic::getOrInsertDeclaration(), getType(), llvm::Value::getType(), llvm::ConstantInt::getZExtValue(), I, llvm::Type::isFloatTy(), llvm::Type::isIntegerTy(), llvm::isValidAtomicOrdering(), llvm::ConstantInt::isZero(), LHS, llvm::AMDGPUAS::LOCAL_ADDRESS, llvm::NotAtomic, Pred, llvm::AMDGPUAS::PRIVATE_ADDRESS, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reportFatalUsageError(), RHS, llvm::SequentiallyConsistent, llvm::CallBase::setCallingConv(), llvm::Instruction::setMetadata(), llvm::CallInst::setTailCallKind(), llvm::AtomicRMWInst::setVolatile(), llvm::StringSwitch< T, R >::StartsWith(), T1, llvm::Value::takeName(), llvm::AtomicRMWInst::UDecWrap, llvm::AtomicRMWInst::UIncWrap, llvm::Unordered, llvm::AtomicRMWInst::USubCond, and llvm::AtomicRMWInst::USubSat.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 5324 of file AutoUpgrade.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::CallBase::args(), C1, F, llvm::FixedVectorType::get(), llvm::VectorType::get(), llvm::CallBase::getArgOperand(), llvm::CallBase::getIntrinsicID(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Value::getType(), and llvm_unreachable.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 795 of file AutoUpgrade.cpp.
References assert(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::cast(), llvm::Default, llvm::StringSwitch< T, R >::Default(), llvm::dyn_cast(), F, llvm::FixedVectorType::get(), llvm::VectorType::get(), llvm::Type::getBFloatTy(), llvm::Intrinsic::getOrInsertDeclaration(), Groups, llvm::Regex::match(), llvm::Intrinsic::not_intrinsic, rename(), llvm::size(), and llvm::StringSwitch< T, R >::StartsWith().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 3075 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::CallBase::args(), assert(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isFPOrFPVectorTy(), llvm_unreachable, and upgradeX86BinaryIntrinsics().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 5700 of file AutoUpgrade.cpp.
References F, llvm::CallBase::getArgOperand(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
Convert debug intrinsic calls to non-instruction debug records.
Name - Final part of the intrinsic name, e.g. 'value' in llvm.dbg.value. CI - The debug intrinsic call.
Definition at line 5639 of file AutoUpgrade.cpp.
References llvm::DIExpression::append(), llvm::CallBase::arg_size(), assert(), llvm::DbgVariableRecord::Assign, llvm::DbgLabelRecord::createUnresolvedDbgLabelRecord(), llvm::DbgVariableRecord::createUnresolvedDbgVariableRecord(), llvm::DbgVariableRecord::Declare, llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::CallBase::getArgOperand(), llvm::Instruction::getDebugLoc(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::Offset, llvm::DbgRecord::setDebugLoc(), unwrapMAVMetadataOp(), unwrapMAVOp(), and llvm::DbgVariableRecord::Value.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 5788 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::Function::arg_size(), llvm::CallBase::args(), assert(), llvm::Instruction::copyMetadata(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::Intrinsic::getAllDefaultArgValues(), llvm::CallBase::getCallingConv(), llvm::CallBase::getFunctionType(), llvm::Function::getFunctionType(), llvm::Function::getIntrinsicID(), llvm::CallBase::getOperandBundlesAsDefs(), llvm::Type::isIntegerTy(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::CallBase::setCalledFunction(), llvm::CallBase::setCallingConv(), llvm::CallInst::setTailCallKind(), and llvm::Value::takeName().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1746 of file AutoUpgrade.cpp.
References assert(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), consumeNVVMPtrAddrSpace(), convertIntrinsicValidType(), llvm::Default, llvm::StringSwitch< T, R >::Default(), F, getNVVMFPArithUpgrade(), llvm::Intrinsic::getOrInsertDeclaration(), Groups, isLegacyNVPTXBF16IntSignature(), llvm::Intrinsic::not_intrinsic, NVVMFAddIIDs, NVVMFMAIIDs, NVVMFMulIIDs, llvm::SmallVectorTemplateBase< T, bool >::push_back(), R2, rename(), shouldUpgradeNVPTXBF16Intrinsic(), shouldUpgradeNVPTXBulkG2SClusterIntrinsic(), shouldUpgradeNVPTXBulkG2SCTAIntrinsic(), shouldUpgradeNVPTXMBarrierInitIntrinsic(), shouldUpgradeNVPTXSharedClusterIntrinsic(), shouldUpgradeNVPTXTcgen05AllocSharedIntrinsic(), shouldUpgradeNVPTXTcgen05CommitSharedIntrinsic(), shouldUpgradeNVPTXTMAG2SCTAIntrinsics(), shouldUpgradeNVPTXTMAG2SIntrinsics(), shouldUpgradeNVPTXTMAReductionIntrinsics(), shouldUpgradeNVVMBarrierMulticastIntrinsic(), shouldUpgradeVPIntrinsic(), llvm::StringSwitch< T, R >::StartsWith(), upgradeArmOrAarch64IntrinsicFunction(), and upgradeX86IntrinsicFunction().
Referenced by llvm::UpgradeIntrinsicFunction().
Definition at line 1730 of file AutoUpgrade.cpp.
References llvm::Function::arg_size(), assert(), F, getFullArgCountForDefaultArgUpgrade(), llvm::Intrinsic::getOrInsertDeclaration(), and rename().
Rewrite a removed two-operand boolean form to the single-operand pair.
Definition at line 8016 of file AutoUpgrade.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, C(), llvm::dyn_cast_or_null(), E(), llvm::findBooleanLoopTags(), llvm::MDTuple::get(), getOldBooleanLoopTags(), llvm::MDString::getString(), llvm::mdconst::hasa(), I, makeBooleanLoopNode(), T, and upgradeLoopTag().
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 8004 of file AutoUpgrade.cpp.
References assert(), C(), llvm::StringRef::drop_front(), llvm::MDString::get(), llvm::StringRef::size(), and llvm::StringRef::starts_with().
Referenced by upgradeLoopArgument().
|
static |
Definition at line 3013 of file AutoUpgrade.cpp.
References applyX86MaskOn1BitsVec(), llvm::CallBase::arg_size(), llvm::cast(), CC, llvm::FixedVectorType::get(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm_unreachable, Pred, and llvm::Signed.
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 2930 of file AutoUpgrade.cpp.
References llvm::Aligned, C(), llvm::cast(), llvm::dyn_cast(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and getX86MaskVec().
Referenced by upgradeX86IntrinsicCall().
Definition at line 3052 of file AutoUpgrade.cpp.
References A(), B(), llvm::CallBase::getArgOperand(), Select, and uint64_t.
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 2912 of file AutoUpgrade.cpp.
References llvm::Aligned, C(), llvm::cast(), llvm::Data, llvm::dyn_cast(), and getX86MaskVec().
Referenced by upgradeX86IntrinsicCall().
Definition at line 3066 of file AutoUpgrade.cpp.
References llvm::cast(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 7011 of file AutoUpgrade.cpp.
References llvm::ArrayRef(), assert(), llvm::cast(), llvm::StringRef::empty(), llvm::mdconst::extract(), F, llvm::join(), llvm::Length, llvm::StringRef::split(), llvm::StringRef::trim(), uint64_t, llvm::utostr(), and V.
Referenced by upgradeSingleNVVMAnnotation().
|
static |
Definition at line 3315 of file AutoUpgrade.cpp.
References llvm::CallBase::args(), assert(), llvm::FixedVectorType::get(), getNVVMFPArithUpgrade(), llvm::Type::getScalarType(), llvm::Value::getType(), and llvm::Type::isIntegerTy().
Referenced by upgradeNVVMIntrinsicCall().
|
static |
Definition at line 3341 of file AutoUpgrade.cpp.
References llvm::AtomicRMWInst::Add, llvm::AtomicRMWInst::And, llvm::Function::arg_size(), assert(), llvm::AtomicRMWInst::BAD_BINOP, C(), llvm::StringSwitch< T, R >::Case(), llvm::cast(), consumeNVVMPtrAddrSpace(), llvm::StringSwitch< T, R >::Default(), F, llvm::AtomicRMWInst::FAdd, llvm::FixedVectorType::get(), llvm::MDNode::get(), llvm::Function::getArg(), llvm::CallBase::getArgOperand(), llvm::Type::getBFloatTy(), llvm::Value::getContext(), llvm::Type::getInt64Ty(), llvm::User::getOperand(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::LLVMContext::getOrInsertSyncScopeID(), llvm::Type::getScalarType(), llvm::Value::getType(), I, llvm::Type::isBFloatTy(), llvm::Type::isIntegerTy(), isLegacyNVPTXBF16IntSignature(), llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::Monotonic, llvm::Intrinsic::not_intrinsic, NVVMFAddIIDs, NVVMFMAIIDs, NVVMFMulIIDs, llvm::AtomicRMWInst::Or, rename(), llvm::FastMathFlags::setApproxFunc(), llvm::Value::setMetadata(), shouldUpgradeNVPTXBF16Intrinsic(), llvm::size(), llvm::StringSwitch< T, R >::StartsWith(), llvm::AtomicRMWInst::UDecWrap, llvm::AtomicRMWInst::UIncWrap, upgradeNVVMFPArithCall(), llvm::AtomicRMWInst::Xchg, and llvm::AtomicRMWInst::Xor.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 2961 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), LHS, and RHS.
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 81 of file AutoUpgrade.cpp.
References F, llvm::FixedVectorType::get(), llvm::Type::getFloatTy(), llvm::Intrinsic::getOrInsertDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
Definition at line 7305 of file AutoUpgrade.cpp.
References assert(), llvm::dyn_cast(), llvm::dyn_cast_if_present(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::Module::Error, llvm::ConstantArray::get(), llvm::ConstantStruct::get(), getModuleFlagNameSafely(), llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::ConstantStruct::getType().
Referenced by llvm::UpgradeModuleFlags().
This checks for objc retain release marker which should be upgraded.
It returns true if module is modified.
Definition at line 7150 of file AutoUpgrade.cpp.
References Changed, llvm::dyn_cast_or_null(), llvm::Module::Error, llvm::MDString::get(), llvm::NamedMDNode::getOperand(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::UpgradeARCRuntime().
|
static |
Definition at line 7048 of file AutoUpgrade.cpp.
References llvm::cast(), llvm::NVVMAttr::ClusterDim(), llvm::mdconst::extract(), llvm::Attribute::get(), llvm::Value::getContext(), llvm::Attribute::getWithStackAlignment(), llvm::NVVMAttr::GridConstant(), isXYZ(), isZero(), llvm::NVVMAttr::MaxClusterRank(), llvm::NVVMAttr::MaxNReg(), llvm::NVVMAttr::MaxNTID(), llvm::NVVMAttr::MinCTASm(), llvm::CallingConv::PTX_Kernel, llvm::NVVMAttr::ReqNTID(), uint64_t, upgradeNVVMFnVectorAttr(), llvm::utostr(), and V.
Referenced by llvm::UpgradeNVVMAnnotations().
Definition at line 5687 of file AutoUpgrade.cpp.
References llvm::dyn_cast(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), llvm::Offset, and llvm::reportFatalUsageError().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 5757 of file AutoUpgrade.cpp.
References llvm::CallBase::args(), llvm::drop_end(), llvm::CallBase::getArgOperand(), getFunctionalIntrinsicIDForVP(), getFunctionalOpcodeForVP(), llvm::Value::getType(), getVPFPPredicateFromMD(), getVPIntPredicateFromMD(), llvm::Instruction::isBinaryOp(), llvm::Instruction::isCast(), llvm::Instruction::isUnaryOp(), llvm_unreachable, and llvm::Value::takeName().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 2694 of file AutoUpgrade.cpp.
References llvm::ArrayRef(), assert(), llvm::cast(), emitX86Select(), llvm::Constant::getNullValue(), llvm::Value::getType(), and llvm::isPowerOf2_32().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 170 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getOrInsertDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 160 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getOrInsertDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 2799 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), emitX86Select(), llvm::User::getOperand(), and llvm::Value::getType().
Referenced by upgradeAVX512MaskToSelect(), and upgradeX86IntrinsicCall().
|
static |
Definition at line 2879 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::cast(), emitX86Select(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::User::getOperand(), llvm::Value::getType(), and std::swap().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 3556 of file AutoUpgrade.cpp.
References A(), AbstractManglingParser< Derived, Alloc >::Ops, llvm::Aligned, applyX86MaskOn1BitsVec(), llvm::CallBase::arg_size(), llvm::CallBase::args(), llvm::ArrayRef(), assert(), B(), C(), llvm::cast(), llvm::Data, emitX86ScalarSelect(), emitX86Select(), F, llvm::FMA, llvm::ConstantAggregateZero::get(), llvm::ConstantAsMetadata::get(), llvm::FixedVectorType::get(), llvm::MDNode::get(), llvm::PoisonValue::get(), llvm::VectorType::get(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::Type::getHalfTy(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::VectorType::getInteger(), llvm::Instruction::getModule(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::ShuffleVectorInst::getShuffleMask(), getType(), llvm::Value::getType(), getX86MaskVec(), High, I, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, Imm, llvm::isa(), llvm::Type::isIntegerTy(), LHS, llvm_unreachable, llvm::Load, llvm::Offset, Pred, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), reportFatalUsageErrorWithCI(), RHS, llvm::Instruction::setMetadata(), llvm::Size, std::swap(), uint64_t, upgradeAbs(), upgradeAVX512MaskToSelect(), upgradeMaskedCompare(), upgradeMaskedLoad(), upgradeMaskedMove(), upgradeMaskedStore(), upgradeMaskToInt(), upgradePMULDQ(), upgradeX86ALIGNIntrinsics(), upgradeX86BinaryIntrinsics(), upgradeX86ConcatShift(), upgradeX86MaskedShift(), upgradeX86PSLLDQIntrinsics(), upgradeX86PSRLDQIntrinsics(), upgradeX86Rotate(), upgradeX86vpcom(), upgradeX86VPERMT2Intrinsics(), llvm::V1, and Zero.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 557 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), F, llvm::Intrinsic::getOrInsertDeclaration(), llvm::Intrinsic::not_intrinsic, rename(), shouldUpgradeX86Intrinsic(), upgradePTESTIntrinsic(), upgradeX86BF16DPIntrinsic(), upgradeX86BF16Intrinsic(), upgradeX86IntrinsicsWith8BitMask(), upgradeX86MaskedFPCompare(), upgradeX86MultiplyAddBytes(), and upgradeX86MultiplyAddWords().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 97 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getOrInsertDeclaration(), llvm::Type::isIntegerTy(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 113 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getOrInsertDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 3045 of file AutoUpgrade.cpp.
References emitX86Select(), and llvm::CallBase::getArgOperand().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 126 of file AutoUpgrade.cpp.
References llvm::cast(), F, llvm::Intrinsic::getOrInsertDeclaration(), llvm::Type::isVectorTy(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 144 of file AutoUpgrade.cpp.
References llvm::cast(), F, llvm::Intrinsic::getOrInsertDeclaration(), llvm::Type::isVectorTy(), and rename().
Referenced by upgradeX86IntrinsicFunction().
Definition at line 2579 of file AutoUpgrade.cpp.
References llvm::ArrayRef(), llvm::cast(), llvm::FixedVectorType::get(), and llvm::Constant::getNullValue().
Referenced by upgradeX86IntrinsicCall().
Definition at line 2613 of file AutoUpgrade.cpp.
References llvm::ArrayRef(), llvm::cast(), llvm::FixedVectorType::get(), and llvm::Constant::getNullValue().
Referenced by upgradeX86IntrinsicCall().
Definition at line 2814 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::cast(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::User::getOperand(), and llvm::Value::getType().
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 2840 of file AutoUpgrade.cpp.
References llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, Imm, LHS, llvm_unreachable, Pred, and RHS.
Referenced by upgradeX86IntrinsicCall().
|
static |
Definition at line 2739 of file AutoUpgrade.cpp.
References emitX86Select(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm_unreachable, std::swap(), and V.
Referenced by upgradeX86IntrinsicCall().
|
staticconstexpr |
Definition at line 1527 of file AutoUpgrade.cpp.
Referenced by upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().
|
staticconstexpr |
Definition at line 1535 of file AutoUpgrade.cpp.
Referenced by isValidLegacyNVVMFPArithIntrinsic(), upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().
|
staticconstexpr |
Definition at line 1531 of file AutoUpgrade.cpp.
Referenced by isValidLegacyNVVMFPArithIntrinsic(), upgradeIntrinsicFunction1(), and upgradeNVVMIntrinsicCall().