LLVM
8.0.1
|
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/IntrinsicInst.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 1188 of file AutoUpgrade.cpp.
References C, llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::IRBuilderBase::getIntNTy(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), getX86MaskVec(), llvm::BitmaskEnumDetail::Mask(), and llvm::max().
Referenced by upgradeMaskedCompare().
|
static |
Definition at line 885 of file AutoUpgrade.cpp.
References C, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateExtractElement(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::VectorType::get(), llvm::IRBuilderBase::getInt1Ty(), llvm::Type::getIntegerBitWidth(), and llvm::Value::getType().
|
static |
Definition at line 874 of file AutoUpgrade.cpp.
References C, llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and getX86MaskVec().
Referenced by upgradeAbs(), upgradeAVX512MaskToSelect(), upgradeIntMinMax(), upgradePMULDQ(), UpgradeX86AddSubSatIntrinsics(), UpgradeX86ALIGNIntrinsics(), upgradeX86ConcatShift(), UpgradeX86MaskedShift(), upgradeX86Rotate(), and UpgradeX86VPERMT2Intrinsics().
Definition at line 854 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::VectorType::get(), getBitWidth(), llvm::IRBuilderBase::getInt1Ty(), llvm::Value::getType(), llvm::makeArrayRef(), and llvm::BitmaskEnumDetail::Mask().
Referenced by ApplyX86MaskOn1BitsVec(), EmitX86Select(), UpgradeMaskedLoad(), UpgradeMaskedStore(), and UpgradeMaskToInt().
Definition at line 3771 of file AutoUpgrade.cpp.
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 34 of file AutoUpgrade.cpp.
References llvm::Value::getName(), and llvm::Value::setName().
Referenced by llvm::sys::fs::TempFile::keep(), UpgradeIntrinsicFunction1(), UpgradePTESTIntrinsic(), UpgradeX86IntrinsicFunction(), and UpgradeX86IntrinsicsWith8BitMask().
Definition at line 68 of file AutoUpgrade.cpp.
References llvm::Function::arg_size(), and llvm::StringRef::startswith().
Referenced by UpgradeX86IntrinsicFunction().
Definition at line 1131 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::IRBuilder< T, Inserter >::CreateNeg(), llvm::IRBuilder< T, Inserter >::CreateSelect(), EmitX86Select(), llvm::CallBase::getArgOperand(), llvm::Constant::getNullValue(), llvm::CallBase::getNumArgOperands(), llvm::Value::getType(), and llvm::CmpInst::ICMP_SGT.
|
static |
Definition at line 1272 of file AutoUpgrade.cpp.
References llvm::CallBase::arg_operands(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::IRBuilder< T, Inserter >::CreateCall(), EmitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::CallBase::getNumArgOperands(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::isFPOrFPVectorTy(), llvm_unreachable, llvm::StringRef::startswith(), llvm::StringRef::substr(), llvm::Intrinsic::x86_avx2_packssdw, llvm::Intrinsic::x86_avx2_packsswb, llvm::Intrinsic::x86_avx2_packusdw, llvm::Intrinsic::x86_avx2_packuswb, llvm::Intrinsic::x86_avx2_permd, llvm::Intrinsic::x86_avx2_permps, llvm::Intrinsic::x86_avx2_pmadd_ub_sw, llvm::Intrinsic::x86_avx2_pmadd_wd, llvm::Intrinsic::x86_avx2_pmul_hr_sw, llvm::Intrinsic::x86_avx2_pmulh_w, llvm::Intrinsic::x86_avx2_pmulhu_w, llvm::Intrinsic::x86_avx2_pshuf_b, llvm::Intrinsic::x86_avx512_dbpsadbw_128, llvm::Intrinsic::x86_avx512_dbpsadbw_256, llvm::Intrinsic::x86_avx512_dbpsadbw_512, llvm::Intrinsic::x86_avx512_packssdw_512, llvm::Intrinsic::x86_avx512_packsswb_512, llvm::Intrinsic::x86_avx512_packusdw_512, llvm::Intrinsic::x86_avx512_packuswb_512, llvm::Intrinsic::x86_avx512_permvar_df_256, llvm::Intrinsic::x86_avx512_permvar_df_512, llvm::Intrinsic::x86_avx512_permvar_di_256, llvm::Intrinsic::x86_avx512_permvar_di_512, llvm::Intrinsic::x86_avx512_permvar_hi_128, llvm::Intrinsic::x86_avx512_permvar_hi_256, llvm::Intrinsic::x86_avx512_permvar_hi_512, llvm::Intrinsic::x86_avx512_permvar_qi_128, llvm::Intrinsic::x86_avx512_permvar_qi_256, llvm::Intrinsic::x86_avx512_permvar_qi_512, llvm::Intrinsic::x86_avx512_permvar_sf_512, llvm::Intrinsic::x86_avx512_permvar_si_512, llvm::Intrinsic::x86_avx512_pmaddubs_w_512, llvm::Intrinsic::x86_avx512_pmaddw_d_512, llvm::Intrinsic::x86_avx512_pmul_hr_sw_512, llvm::Intrinsic::x86_avx512_pmulh_w_512, llvm::Intrinsic::x86_avx512_pmulhu_w_512, llvm::Intrinsic::x86_avx512_pmultishift_qb_128, llvm::Intrinsic::x86_avx512_pmultishift_qb_256, llvm::Intrinsic::x86_avx512_pmultishift_qb_512, llvm::Intrinsic::x86_avx512_pshuf_b_512, llvm::Intrinsic::x86_avx512_vpermilvar_pd_512, llvm::Intrinsic::x86_avx512_vpermilvar_ps_512, llvm::Intrinsic::x86_avx_cvt_pd2_ps_256, llvm::Intrinsic::x86_avx_cvt_pd2dq_256, llvm::Intrinsic::x86_avx_cvtt_pd2dq_256, llvm::Intrinsic::x86_avx_cvtt_ps2dq_256, llvm::Intrinsic::x86_avx_max_pd_256, llvm::Intrinsic::x86_avx_max_ps_256, llvm::Intrinsic::x86_avx_min_pd_256, llvm::Intrinsic::x86_avx_min_ps_256, llvm::Intrinsic::x86_avx_vpermilvar_pd, llvm::Intrinsic::x86_avx_vpermilvar_pd_256, llvm::Intrinsic::x86_avx_vpermilvar_ps, llvm::Intrinsic::x86_avx_vpermilvar_ps_256, llvm::Intrinsic::x86_sse2_cvttps2dq, llvm::Intrinsic::x86_sse2_max_pd, llvm::Intrinsic::x86_sse2_min_pd, llvm::Intrinsic::x86_sse2_packssdw_128, llvm::Intrinsic::x86_sse2_packsswb_128, llvm::Intrinsic::x86_sse2_packuswb_128, llvm::Intrinsic::x86_sse2_pmadd_wd, llvm::Intrinsic::x86_sse2_pmulh_w, llvm::Intrinsic::x86_sse2_pmulhu_w, llvm::Intrinsic::x86_sse41_packusdw, llvm::Intrinsic::x86_sse_max_ps, llvm::Intrinsic::x86_sse_min_ps, llvm::Intrinsic::x86_ssse3_pmadd_ub_sw_128, llvm::Intrinsic::x86_ssse3_pmul_hr_sw_128, and llvm::Intrinsic::x86_ssse3_pshuf_b_128.
|
static |
Definition at line 1145 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::IRBuilder< T, Inserter >::CreateSelect(), EmitX86Select(), llvm::CallBase::getArgOperand(), and llvm::CallBase::getNumArgOperands().
Definition at line 480 of file AutoUpgrade.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_size(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::Intrinsic::arm_neon_vst1, llvm::Intrinsic::arm_neon_vst2, llvm::Intrinsic::arm_neon_vst2lane, llvm::Intrinsic::arm_neon_vst3, llvm::Intrinsic::arm_neon_vst3lane, llvm::Intrinsic::arm_neon_vst4, llvm::Intrinsic::arm_neon_vst4lane, assert(), llvm::Intrinsic::bitreverse, llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::Function::Create(), llvm::Intrinsic::ctlz, llvm::Intrinsic::ctpop, llvm::Intrinsic::cttz, llvm::Intrinsic::dbg_value, llvm::StringSwitch< T, R >::Default(), llvm::StringRef::find(), llvm::FunctionType::get(), llvm::GlobalValue::getAddressSpace(), llvm::Function::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::Type::getInt1Ty(), llvm::GlobalValue::getLinkage(), llvm::Intrinsic::getName(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::Function::getReturnType(), llvm::Value::getType(), llvm::Intrinsic::invariant_end, llvm::Intrinsic::invariant_start, llvm::Intrinsic::launder_invariant_group, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, llvm::Intrinsic::masked_gather, llvm::Intrinsic::masked_load, llvm::Intrinsic::masked_scatter, llvm::Intrinsic::masked_store, llvm::Regex::match(), llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, Name, llvm::None, llvm::Intrinsic::not_intrinsic, llvm::StringRef::npos, llvm::Intrinsic::objectsize, llvm::FunctionType::params(), llvm::Intrinsic::remangleIntrinsicFunction(), rename(), llvm::StringRef::size(), llvm::StringRef::startswith(), llvm::StringRef::substr(), llvm::Intrinsic::thread_pointer, and UpgradeX86IntrinsicFunction().
Referenced by llvm::UpgradeIntrinsicFunction().
Definition at line 3795 of file AutoUpgrade.cpp.
References E, llvm::MDTuple::get(), I, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and upgradeLoopTag().
Referenced by llvm::upgradeInstructionLoopAttachment().
|
static |
Definition at line 3783 of file AutoUpgrade.cpp.
References assert(), llvm::StringRef::drop_front(), llvm::MDString::get(), llvm::StringRef::size(), and llvm::StringRef::startswith().
Referenced by upgradeLoopArgument().
|
static |
Definition at line 1210 of file AutoUpgrade.cpp.
References ApplyX86MaskOn1BitsVec(), llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::VectorType::get(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::IRBuilderBase::getInt1Ty(), llvm::Constant::getNullValue(), llvm::CallBase::getNumArgOperands(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm_unreachable, and llvm::BitmaskEnumDetail::Mask().
|
static |
Definition at line 1111 of file AutoUpgrade.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, C, llvm::IRBuilder< T, Inserter >::CreateAlignedLoad(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedLoad(), getBitWidth(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::Type::getVectorNumElements(), and getX86MaskVec().
Definition at line 1248 of file AutoUpgrade.cpp.
References A, B, llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateExtractElement(), llvm::IRBuilder< T, Inserter >::CreateInsertElement(), llvm::IRBuilder< T, Inserter >::CreateIsNotNull(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::CallBase::getArgOperand(), llvm::BitmaskEnumDetail::Mask(), and llvm::MCID::Select.
|
static |
Definition at line 1091 of file AutoUpgrade.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, C, llvm::IRBuilder< T, Inserter >::CreateAlignedStore(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedStore(), getBitWidth(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::Type::getVectorNumElements(), and getX86MaskVec().
Definition at line 1263 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateSExt(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), getX86MaskVec(), and llvm::BitmaskEnumDetail::Mask().
Definition at line 1158 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateAShr(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateShl(), EmitX86Select(), llvm::ConstantInt::get(), llvm::CallBase::getArgOperand(), llvm::CallBase::getNumArgOperands(), llvm::Value::getType(), and llvm::BitmaskEnumDetail::Mask().
|
static |
Definition at line 38 of file AutoUpgrade.cpp.
References llvm::VectorType::get(), llvm::Function::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getFloatTy(), llvm::Function::getFunctionType(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1010 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateCall(), EmitX86Select(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::CallBase::getNumArgOperands(), llvm::User::getOperand(), llvm::Value::getType(), llvm::BitmaskEnumDetail::Mask(), llvm::Intrinsic::sadd_sat, llvm::Intrinsic::ssub_sat, llvm::Intrinsic::uadd_sat, and llvm::Intrinsic::usub_sat.
|
static |
Definition at line 903 of file AutoUpgrade.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), EmitX86Select(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::isPowerOf2_32(), and llvm::makeArrayRef().
|
static |
Definition at line 1057 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateIntCast(), llvm::IRBuilder< T, Inserter >::CreateVectorSplat(), EmitX86Select(), llvm::Intrinsic::fshl, llvm::Intrinsic::fshr, llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::CallBase::getNumArgOperands(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::BitmaskEnumDetail::Mask(), and std::swap().
Definition at line 384 of file AutoUpgrade.cpp.
References llvm::Function::arg_size(), llvm::Intrinsic::eh_recoverfp, llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), rename(), ShouldUpgradeX86Intrinsic(), llvm::StringRef::startswith(), llvm::StringRef::substr(), UpgradePTESTIntrinsic(), UpgradeX86IntrinsicsWith8BitMask(), llvm::Intrinsic::x86_avx2_mpsadbw, llvm::Intrinsic::x86_avx_dp_ps_256, llvm::Intrinsic::x86_rdtscp, llvm::Intrinsic::x86_sse41_dppd, llvm::Intrinsic::x86_sse41_dpps, llvm::Intrinsic::x86_sse41_insertps, llvm::Intrinsic::x86_sse41_mpsadbw, llvm::Intrinsic::x86_sse41_ptestc, llvm::Intrinsic::x86_sse41_ptestnzc, llvm::Intrinsic::x86_sse41_ptestz, llvm::Intrinsic::x86_xop_vfrcz_sd, llvm::Intrinsic::x86_xop_vfrcz_ss, llvm::Intrinsic::x86_xop_vpermil2pd, llvm::Intrinsic::x86_xop_vpermil2pd_256, llvm::Intrinsic::x86_xop_vpermil2ps, and llvm::Intrinsic::x86_xop_vpermil2ps_256.
Referenced by UpgradeIntrinsicFunction1().
|
static |
Definition at line 54 of file AutoUpgrade.cpp.
References llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), llvm::Type::isIntegerTy(), and rename().
Referenced by UpgradeX86IntrinsicFunction().
|
static |
Definition at line 1240 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateCall(), EmitX86Select(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), and llvm::Instruction::getModule().
|
static |
Definition at line 788 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::VectorType::get(), llvm::IRBuilderBase::getInt8Ty(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::makeArrayRef().
|
static |
Definition at line 822 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::VectorType::get(), llvm::IRBuilderBase::getInt8Ty(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::makeArrayRef().
Definition at line 1030 of file AutoUpgrade.cpp.
References llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateIntCast(), llvm::IRBuilder< T, Inserter >::CreateVectorSplat(), EmitX86Select(), llvm::Intrinsic::fshl, llvm::Intrinsic::fshr, llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::CallBase::getNumArgOperands(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::BitmaskEnumDetail::Mask().
|
static |
Definition at line 949 of file AutoUpgrade.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::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, std::swap(), llvm::Intrinsic::x86_avx512_vpermi2var_d_128, llvm::Intrinsic::x86_avx512_vpermi2var_d_256, llvm::Intrinsic::x86_avx512_vpermi2var_d_512, llvm::Intrinsic::x86_avx512_vpermi2var_hi_128, llvm::Intrinsic::x86_avx512_vpermi2var_hi_256, llvm::Intrinsic::x86_avx512_vpermi2var_hi_512, llvm::Intrinsic::x86_avx512_vpermi2var_pd_128, llvm::Intrinsic::x86_avx512_vpermi2var_pd_256, llvm::Intrinsic::x86_avx512_vpermi2var_pd_512, llvm::Intrinsic::x86_avx512_vpermi2var_ps_128, llvm::Intrinsic::x86_avx512_vpermi2var_ps_256, llvm::Intrinsic::x86_avx512_vpermi2var_ps_512, llvm::Intrinsic::x86_avx512_vpermi2var_q_128, llvm::Intrinsic::x86_avx512_vpermi2var_q_256, llvm::Intrinsic::x86_avx512_vpermi2var_q_512, llvm::Intrinsic::x86_avx512_vpermi2var_qi_128, llvm::Intrinsic::x86_avx512_vpermi2var_qi_256, and llvm::Intrinsic::x86_avx512_vpermi2var_qi_512.