LLVM 18.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 1776 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, llvm::Constant::getNullValue(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall(), and upgradeMaskedCompare().
|
static |
Definition at line 1451 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, and llvm::FixedVectorType::get().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1439 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, llvm::Value::getType(), and getX86MaskVec().
Referenced by upgradeAbs(), upgradeAVX512MaskToSelect(), llvm::UpgradeIntrinsicCall(), upgradePMULDQ(), UpgradeX86ALIGNIntrinsics(), UpgradeX86BinaryIntrinsics(), upgradeX86ConcatShift(), UpgradeX86MaskedShift(), upgradeX86Rotate(), and UpgradeX86VPERMT2Intrinsics().
Definition at line 1419 of file AutoUpgrade.cpp.
References assert(), Builder, llvm::FixedVectorType::get(), and llvm::isPowerOf2_32().
Referenced by ApplyX86MaskOn1BitsVec(), EmitX86Select(), llvm::UpgradeIntrinsicCall(), UpgradeMaskedLoad(), UpgradeMaskedStore(), and UpgradeMaskToInt().
Definition at line 5093 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 llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradePTESTIntrinsic(), UpgradeX86BF16DPIntrinsic(), UpgradeX86BF16Intrinsic(), UpgradeX86IntrinsicFunction(), UpgradeX86IntrinsicsWith8BitMask(), and UpgradeX86MaskedFPCompare().
|
static |
Definition at line 595 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 1736 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), Builder, EmitX86Select(), F, llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 2205 of file AutoUpgrade.cpp.
References Builder, 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 2111 of file AutoUpgrade.cpp.
References llvm::CallBase::args(), Builder, F, llvm::FixedVectorType::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), 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 1862 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), llvm::CallBase::args(), Builder, 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 675 of file AutoUpgrade.cpp.
References args, assert(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::Function::Create(), llvm::StringSwitch< T, R >::Default(), Default, F, llvm::FixedVectorType::get(), llvm::Type::getBFloatTy(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt1Ty(), llvm::Intrinsic::getName(), Groups, llvm::Regex::match(), Name, llvm::Intrinsic::not_intrinsic, llvm::SmallVectorTemplateBase< T, bool >::push_back(), R2, rename(), ShouldUpgradeNVPTXBF16Intrinsic(), llvm::StringSwitch< T, R >::StartsWith(), and UpgradeX86IntrinsicFunction().
Referenced by llvm::UpgradeIntrinsicFunction().
Definition at line 5117 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 5105 of file AutoUpgrade.cpp.
References assert(), llvm::CallingConv::C, llvm::StringRef::drop_front(), llvm::MDString::get(), llvm::StringRef::size(), and llvm::StringRef::startswith().
Referenced by upgradeLoopArgument().
|
static |
Definition at line 1798 of file AutoUpgrade.cpp.
References ApplyX86MaskOn1BitsVec(), llvm::CallBase::arg_size(), Builder, CC, llvm::FixedVectorType::get(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm_unreachable, and Signed.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1712 of file AutoUpgrade.cpp.
References llvm::Aligned, Builder, llvm::CallingConv::C, 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 1838 of file AutoUpgrade.cpp.
References A, B, Builder, llvm::CallBase::getArgOperand(), and Select.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1690 of file AutoUpgrade.cpp.
References llvm::Aligned, Builder, llvm::CallingConv::C, llvm::Data, llvm::PointerType::getUnqual(), getX86MaskVec(), and Ptr.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1853 of file AutoUpgrade.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1746 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), Builder, EmitX86Select(), llvm::ConstantInt::get(), 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 4743 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 1468 of file AutoUpgrade.cpp.
References assert(), Builder, 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 1574 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), Builder, EmitX86Select(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::User::getOperand(), and llvm::Value::getType().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1656 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), Builder, 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 454 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), Idx, Name, 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 1830 of file AutoUpgrade.cpp.
References Builder, EmitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), and llvm::Instruction::getModule().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1353 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1387 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1590 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_size(), Builder, 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 1617 of file AutoUpgrade.cpp.
References Builder, 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 1513 of file AutoUpgrade.cpp.
References Builder, 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().