LLVM 19.0.0git
|
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/AttributeMask.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/IRBuilder.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/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/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Regex.h"
#include "llvm/TargetParser/Triple.h"
#include <cstring>
Go to the source code of this file.
Variables | |
static cl::opt< bool > | DisableAutoUpgradeDebugInfo ("disable-auto-upgrade-debug-info", cl::desc("Disable autoupgrade of debug info")) |
Definition at line 1867 of file AutoUpgrade.cpp.
References llvm::CallingConv::C, llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::IRBuilderBase::getIntNTy(), llvm::Constant::getNullValue(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall(), and upgradeMaskedCompare().
|
static |
Definition at line 1544 of file AutoUpgrade.cpp.
References llvm::CallingConv::C, llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateSelect(), llvm::FixedVectorType::get(), and llvm::IRBuilderBase::getInt1Ty().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1532 of file AutoUpgrade.cpp.
References llvm::CallingConv::C, llvm::IRBuilderBase::CreateSelect(), llvm::Value::getType(), and getX86MaskVec().
Referenced by upgradeAbs(), upgradeAVX512MaskToSelect(), llvm::UpgradeIntrinsicCall(), upgradePMULDQ(), upgradeX86ALIGNIntrinsics(), upgradeX86BinaryIntrinsics(), upgradeX86ConcatShift(), upgradeX86MaskedShift(), upgradeX86Rotate(), and upgradeX86VPERMT2Intrinsics().
Definition at line 1512 of file AutoUpgrade.cpp.
References assert(), llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::FixedVectorType::get(), llvm::IntegerType::getBitWidth(), llvm::IRBuilderBase::getInt1Ty(), and llvm::isPowerOf2_32().
Referenced by applyX86MaskOn1BitsVec(), emitX86Select(), llvm::UpgradeIntrinsicCall(), upgradeMaskedLoad(), upgradeMaskedStore(), and upgradeMaskToInt().
Definition at line 5181 of file AutoUpgrade.cpp.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 52 of file AutoUpgrade.cpp.
References llvm::Value::getName(), and llvm::Value::setName().
Referenced by upgradeArmOrAarch64IntrinsicFunction(), llvm::UpgradeIntrinsicCall(), upgradeIntrinsicFunction1(), upgradePTESTIntrinsic(), upgradeX86BF16DPIntrinsic(), upgradeX86BF16Intrinsic(), upgradeX86IntrinsicFunction(), upgradeX86IntrinsicsWith8BitMask(), and upgradeX86MaskedFPCompare().
|
static |
Definition at line 902 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), Name, and llvm::Intrinsic::not_intrinsic.
Referenced by llvm::UpgradeIntrinsicCall(), and upgradeIntrinsicFunction1().
Definition at line 119 of file AutoUpgrade.cpp.
References Name.
Referenced by upgradeX86IntrinsicFunction().
Definition at line 1827 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::IRBuilderBase::CreateCall(), emitX86Select(), F, llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::IRBuilderBase::getInt1(), llvm::Instruction::getModule(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 2295 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateAtomicRMW(), F, llvm::CallBase::getArgOperand(), llvm::User::getNumOperands(), llvm::ConstantInt::getZExtValue(), llvm::isValidAtomicOrdering(), llvm::ConstantInt::isZero(), llvm_unreachable, Name, Ptr, llvm::AtomicRMWInst::setVolatile(), llvm::AtomicRMWInst::UDecWrap, and llvm::AtomicRMWInst::UIncWrap.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 2201 of file AutoUpgrade.cpp.
References llvm::CallBase::args(), llvm::IRBuilderBase::CreateCall(), F, llvm::FixedVectorType::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::IRBuilderBase::getInt1Ty(), llvm::CallBase::getIntrinsicID(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm_unreachable, and Name.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 626 of file AutoUpgrade.cpp.
References assert(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::StringSwitch< T, R >::Default(), F, llvm::FixedVectorType::get(), llvm::Type::getBFloatTy(), llvm::Intrinsic::getDeclaration(), Groups, llvm::Regex::match(), Name, llvm::Intrinsic::not_intrinsic, rename(), llvm::size(), and llvm::StringSwitch< T, R >::StartsWith().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 1952 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::CallBase::args(), llvm::IRBuilderBase::CreateCall(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isFPOrFPVectorTy(), llvm_unreachable, and Name.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 982 of file AutoUpgrade.cpp.
References assert(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::StringSwitch< T, R >::Default(), Default, F, llvm::Intrinsic::getDeclaration(), llvm::Intrinsic::getName(), Groups, Name, llvm::Intrinsic::not_intrinsic, llvm::SmallVectorTemplateBase< T, bool >::push_back(), R2, rename(), shouldUpgradeNVPTXBF16Intrinsic(), llvm::StringSwitch< T, R >::StartsWith(), upgradeArmOrAarch64IntrinsicFunction(), and upgradeX86IntrinsicFunction().
Referenced by llvm::UpgradeIntrinsicFunction().
Definition at line 5205 of file AutoUpgrade.cpp.
References E, llvm::MDTuple::get(), I, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and upgradeLoopTag().
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 5193 of file AutoUpgrade.cpp.
References assert(), llvm::CallingConv::C, llvm::StringRef::drop_front(), llvm::MDString::get(), llvm::StringRef::size(), and llvm::StringRef::starts_with().
Referenced by upgradeLoopArgument().
|
static |
Definition at line 1889 of file AutoUpgrade.cpp.
References applyX86MaskOn1BitsVec(), llvm::CallBase::arg_size(), CC, llvm::IRBuilderBase::CreateICmp(), llvm::FixedVectorType::get(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::IRBuilderBase::getInt1Ty(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm_unreachable, and Signed.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1804 of file AutoUpgrade.cpp.
References llvm::Aligned, llvm::CallingConv::C, llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::PointerType::getUnqual(), getX86MaskVec(), and Ptr.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1929 of file AutoUpgrade.cpp.
References A, B, llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateInsertElement(), llvm::IRBuilderBase::CreateIsNotNull(), llvm::IRBuilderBase::CreateSelect(), llvm::CallBase::getArgOperand(), and Select.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1783 of file AutoUpgrade.cpp.
References llvm::Aligned, llvm::CallingConv::C, llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::PointerType::getUnqual(), getX86MaskVec(), and Ptr.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1943 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateSExt(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1837 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateAShr(), llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateMul(), llvm::IRBuilderBase::CreateShl(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), LHS, and RHS.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 56 of file AutoUpgrade.cpp.
References F, llvm::FixedVectorType::get(), llvm::Intrinsic::getDeclaration(), llvm::Type::getFloatTy(), and rename().
Referenced by upgradeX86IntrinsicFunction().
This checks for objc retain release marker which should be upgraded.
It returns true if module is modified.
Definition at line 4822 of file AutoUpgrade.cpp.
References llvm::Module::Error, llvm::MDString::get(), llvm::NamedMDNode::getOperand(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::UpgradeARCRuntime().
|
static |
Definition at line 1561 of file AutoUpgrade.cpp.
References assert(), llvm::IRBuilderBase::CreateShuffleVector(), emitX86Select(), llvm::Constant::getNullValue(), llvm::Value::getType(), Idx, and llvm::isPowerOf2_32().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 109 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 99 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 1667 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::IRBuilderBase::CreateCall(), emitX86Select(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::User::getOperand(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1749 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::CreateIntCast(), llvm::IRBuilderBase::CreateVectorSplat(), emitX86Select(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), and std::swap().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 486 of file AutoUpgrade.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), F, llvm::Intrinsic::getDeclaration(), Idx, Name, llvm::Intrinsic::not_intrinsic, rename(), shouldUpgradeX86Intrinsic(), upgradePTESTIntrinsic(), upgradeX86BF16DPIntrinsic(), upgradeX86BF16Intrinsic(), upgradeX86IntrinsicsWith8BitMask(), and upgradeX86MaskedFPCompare().
Referenced by upgradeIntrinsicFunction1().
|
static |
Definition at line 72 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), llvm::Type::isIntegerTy(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 88 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by upgradeX86IntrinsicFunction().
|
static |
Definition at line 1921 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateCall(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), and llvm::Instruction::getModule().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1446 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::FixedVectorType::get(), llvm::IRBuilderBase::getInt8Ty(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1480 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::FixedVectorType::get(), llvm::IRBuilderBase::getInt8Ty(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1683 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::CreateIntCast(), llvm::IRBuilderBase::CreateVectorSplat(), emitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1710 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateICmp(), llvm::IRBuilderBase::CreateSExt(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::Constant::getNullValue(), llvm::Value::getType(), LHS, llvm_unreachable, and RHS.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1606 of file AutoUpgrade.cpp.
References llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreateCall(), emitX86Select(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isFPOrFPVectorTy(), llvm_unreachable, and std::swap().
Referenced by llvm::UpgradeIntrinsicCall().