LLVM
15.0.0git
|
#include "AMDGPUInstrInfo.h"
#include "AMDGPUTargetTransformInfo.h"
#include "GCNSubtarget.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/Transforms/InstCombine/InstCombiner.h"
#include "InstCombineTables.inc"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "AMDGPUtti" |
#define | GET_AMDGPUImageDMaskIntrinsicTable_IMPL |
Functions | |
static APFloat | fmed3AMDGCN (const APFloat &Src0, const APFloat &Src1, const APFloat &Src2) |
static bool | canSafelyConvertTo16Bit (Value &V, bool IsFloat) |
static Value * | convertTo16Bit (Value &V, InstCombiner::BuilderTy &Builder) |
static Optional< Instruction * > | modifyIntrinsicCall (IntrinsicInst &OldIntr, Instruction &InstToReplace, unsigned NewIntr, InstCombiner &IC, std::function< void(SmallVectorImpl< Value * > &, SmallVectorImpl< Type * > &)> Func) |
Applies Func(OldIntr.Args, OldIntr.ArgTys), creates intrinsic call with modified arguments (based on OldIntr) and replaces InstToReplace with this newly created intrinsic call. More... | |
static Optional< Instruction * > | simplifyAMDGCNImageIntrinsic (const GCNSubtarget *ST, const AMDGPU::ImageDimIntrinsicInfo *ImageDimIntr, IntrinsicInst &II, InstCombiner &IC) |
static Value * | simplifyAMDGCNMemoryIntrinsicDemanded (InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, int DMaskIdx=-1) |
Implement SimplifyDemandedVectorElts for amdgcn buffer and image intrinsics. More... | |
#define DEBUG_TYPE "AMDGPUtti" |
Definition at line 25 of file AMDGPUInstCombineIntrinsic.cpp.
#define GET_AMDGPUImageDMaskIntrinsicTable_IMPL |
Definition at line 33 of file AMDGPUInstCombineIntrinsic.cpp.
|
static |
Definition at line 63 of file AMDGPUInstCombineIntrinsic.cpp.
References llvm::APFloat::convert(), llvm::APInt::getActiveBits(), llvm::Value::getType(), llvm::APFloatBase::IEEEhalf(), llvm::Type::isHalfTy(), llvm::Type::isIntegerTy(), llvm::PatternMatch::m_FPExt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), and llvm::APFloatBase::rmTowardZero.
Referenced by simplifyAMDGCNImageIntrinsic().
|
static |
Definition at line 101 of file AMDGPUInstCombineIntrinsic.cpp.
References Builder, llvm::Value::getContext(), llvm::Type::getHalfTy(), llvm::Type::getInt16Ty(), llvm::Value::getType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), and llvm_unreachable.
|
static |
Definition at line 42 of file AMDGPUInstCombineIntrinsic.cpp.
References assert(), llvm::APFloatBase::cmpEqual, llvm::APFloatBase::cmpUnordered, llvm::APFloat::compare(), and llvm::maxnum().
Referenced by llvm::GCNTTIImpl::instCombineIntrinsic().
|
static |
Applies Func(OldIntr.Args, OldIntr.ArgTys), creates intrinsic call with modified arguments (based on OldIntr) and replaces InstToReplace with this newly created intrinsic call.
Definition at line 116 of file AMDGPUInstCombineIntrinsic.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::CallBase::args(), llvm::InstCombiner::Builder, llvm::Instruction::copyFastMathFlags(), llvm::Instruction::copyMetadata(), llvm::IRBuilderBase::CreateCall(), llvm::InstCombiner::eraseInstFromFunction(), llvm::CallBase::getCalledFunction(), llvm::Intrinsic::getDeclaration(), llvm::Intrinsic::getIntrinsicSignature(), llvm::Instruction::getModule(), llvm::Value::getType(), I, llvm::Type::isVoidTy(), llvm::None, llvm::InstCombiner::replaceInstUsesWith(), and llvm::Value::takeName().
Referenced by simplifyAMDGCNImageIntrinsic().
|
static |
Definition at line 152 of file AMDGPUInstCombineIntrinsic.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), canSafelyConvertTo16Bit(), for, llvm::Value::getContext(), llvm::Type::getHalfTy(), llvm::AMDGPU::getImageDimIntrinsicByBaseOpcode(), llvm::Type::getInt16Ty(), llvm::IntrinsicInst::getIntrinsicID(), llvm::AMDGPU::getMIMGBaseOpcodeInfo(), llvm::AMDGPU::getMIMGBiasMappingInfo(), llvm::AMDGPU::getMIMGLZMappingInfo(), llvm::AMDGPU::getMIMGMIPMappingInfo(), llvm::AMDGPU::getMIMGOffsetMappingInfo(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Value::hasOneUse(), if(), llvm::Type::isFloatingPointTy(), llvm::Type::isHalfTy(), modifyIntrinsicCall(), llvm::None, llvm::AMDGPU::MIMGBaseOpcodeInfo::Sampler, llvm::ARM_MB::ST, and llvm::Instruction::user_back().
Referenced by llvm::GCNTTIImpl::instCombineIntrinsic().
|
static |
Implement SimplifyDemandedVectorElts for amdgcn buffer and image intrinsics.
Note: This only supports non-TFE/LWE image intrinsic calls; those have struct returns.
Definition at line 1078 of file AMDGPUInstCombineIntrinsic.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::CallBase::args(), llvm::tgtok::Bit, llvm::InstCombiner::Builder, llvm::Instruction::copyMetadata(), llvm::countPopulation(), llvm::APInt::countPopulation(), llvm::APInt::countTrailingZeros(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::CreateInsertElement(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::ConstantInt::get(), llvm::FixedVectorType::get(), llvm::UndefValue::get(), llvm::APInt::getActiveBits(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::InstCombiner::getDataLayout(), llvm::Intrinsic::getDeclaration(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Intrinsic::getIntrinsicSignature(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Type::getScalarType(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::ConstantInt::getZExtValue(), llvm::APInt::isMask(), M, llvm::CallBase::setArgOperand(), llvm::IRBuilderBase::SetInsertPoint(), and llvm::Value::takeName().
Referenced by llvm::GCNTTIImpl::simplifyDemandedVectorEltsIntrinsic().