LLVM 17.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/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 1694 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 1369 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, and llvm::FixedVectorType::get().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1357 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 1337 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 4900 of file AutoUpgrade.cpp.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 49 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 116 of file AutoUpgrade.cpp.
References Name.
Referenced by UpgradeX86IntrinsicFunction().
Definition at line 1654 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 2029 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 1780 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 592 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 4924 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 4912 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 1716 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 1630 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 1756 of file AutoUpgrade.cpp.
References A, B, Builder, llvm::CallBase::getArgOperand(), and Select.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1608 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 1771 of file AutoUpgrade.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1664 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 53 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 4550 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 1386 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 106 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 96 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1492 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 1574 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 451 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 69 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), llvm::Type::isIntegerTy(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 85 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1748 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 1271 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1305 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1508 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 1535 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 1431 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().