LLVM 17.0.0git
|
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.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/IntrinsicsX86.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Regex.h"
#include <cstring>
Go to the source code of this file.
Definition at line 1644 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 1319 of file AutoUpgrade.cpp.
References Builder, llvm::CallingConv::C, and llvm::FixedVectorType::get().
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1307 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 1287 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 4836 of file AutoUpgrade.cpp.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 38 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 105 of file AutoUpgrade.cpp.
References Name.
Referenced by UpgradeX86IntrinsicFunction().
Definition at line 1604 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 1979 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 1730 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 581 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 4860 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 4848 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 1666 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 1580 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 1706 of file AutoUpgrade.cpp.
References A, B, Builder, llvm::CallBase::getArgOperand(), and Select.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1558 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 1721 of file AutoUpgrade.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getType(), and getX86MaskVec().
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1614 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 42 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 4486 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 1336 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 95 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), 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 1442 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 1524 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 440 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 58 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), llvm::Type::isIntegerTy(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 74 of file AutoUpgrade.cpp.
References F, llvm::Intrinsic::getDeclaration(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1698 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 1221 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1255 of file AutoUpgrade.cpp.
References Builder, llvm::FixedVectorType::get(), llvm::Constant::getNullValue(), and Idx.
Referenced by llvm::UpgradeIntrinsicCall().
Definition at line 1458 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 1485 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 1381 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().