LLVM 17.0.0git
|
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Dwarf.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/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 1693 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 1368 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, and llvm::FixedVectorType::get().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1356 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 1336 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 4902 of file AutoUpgrade.cpp.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 48 of file AutoUpgrade.cpp.
References llvm::Value::getName(), and llvm::Value::setName().
Referenced by UpgradeIntrinsicFunction1(), UpgradePTESTIntrinsic(), UpgradeX86BF16DPIntrinsic(), UpgradeX86BF16Intrinsic(), UpgradeX86IntrinsicFunction(), UpgradeX86IntrinsicsWith8BitMask(), and UpgradeX86MaskedFPCompare().
Definition at line 115 of file AutoUpgrade.cpp.
References Name.
Referenced by UpgradeX86IntrinsicFunction().
Definition at line 1653 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 2028 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 1779 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 591 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(), 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, R2, rename(), llvm::StringSwitch< T, R >::StartsWith(), and UpgradeX86IntrinsicFunction().
Referenced by llvm::UpgradeIntrinsicFunction().
Definition at line 4926 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 4914 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 1715 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 1629 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 1755 of file AutoUpgrade.cpp.
References A, B, Builder, llvm::CallBase::getArgOperand(), and Select.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1607 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 1770 of file AutoUpgrade.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1663 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 52 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 4552 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 1385 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 105 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 95 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1491 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 1573 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 450 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 68 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), llvm::Type::isIntegerTy(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 84 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1747 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 1270 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1304 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1507 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 1534 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 1430 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().