LLVM
8.0.1
|
This pass does misc. More...
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "AMDGPUTargetMachine.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/LegacyDivergenceAnalysis.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <iterator>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "amdgpu-codegenprepare" |
Functions | |
static bool | promotedOpIsNSW (const Instruction &I) |
static bool | promotedOpIsNUW (const Instruction &I) |
static bool | shouldKeepFDivF32 (Value *Num, bool UnsafeDiv, bool HasDenormals) |
static bool | hasUnsafeFPMath (const Function &F) |
static std::pair< Value *, Value * > | getMul64 (IRBuilder<> &Builder, Value *LHS, Value *RHS) |
static Value * | getMulHu (IRBuilder<> &Builder, Value *LHS, Value *RHS) |
INITIALIZE_PASS_BEGIN (AMDGPUCodeGenPrepare, DEBUG_TYPE, "AMDGPU IR optimizations", false, false) INITIALIZE_PASS_END(AMDGPUCodeGenPrepare | |
Variables | |
DEBUG_TYPE | |
AMDGPU IR | optimizations |
AMDGPU IR | false |
This pass does misc.
AMDGPU optimizations on IR before instruction selection.
Definition in file AMDGPUCodeGenPrepare.cpp.
#define DEBUG_TYPE "amdgpu-codegenprepare" |
Definition at line 47 of file AMDGPUCodeGenPrepare.cpp.
Referenced by getMulHu().
|
static |
Definition at line 485 of file AMDGPUCodeGenPrepare.cpp.
References llvm::IRBuilder< T, Inserter >::CreateLShr(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateTrunc(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::IRBuilderBase::getInt32Ty(), llvm::IRBuilderBase::getInt64(), llvm::IRBuilderBase::getInt64Ty(), llvm::MipsISD::Hi, and llvm::MipsISD::Lo.
Referenced by getMulHu().
Definition at line 499 of file AMDGPUCodeGenPrepare.cpp.
References llvm::Intrinsic::amdgcn_fmad_ftz, assert(), llvm::Intrinsic::bitreverse, llvm::BitsToFloat(), llvm::ComputeNumSignBits(), AMDGPUAS::CONSTANT_ADDRESS, AMDGPUAS::CONSTANT_ADDRESS_32BIT, llvm::Instruction::copyFastMathFlags(), llvm::Instruction::copyMetadata(), llvm::IRBuilder< T, Inserter >::CreateAdd(), llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateAShr(), llvm::IRBuilder< T, Inserter >::CreateBinOp(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateExtractElement(), llvm::IRBuilder< T, Inserter >::CreateFCmpOGE(), llvm::IRBuilder< T, Inserter >::CreateFDiv(), llvm::IRBuilder< T, Inserter >::CreateFMul(), llvm::IRBuilder< T, Inserter >::CreateFNeg(), llvm::IRBuilder< T, Inserter >::CreateFPToSI(), llvm::IRBuilder< T, Inserter >::CreateFPToUI(), llvm::IRBuilder< T, Inserter >::CreateICmpEQ(), llvm::IRBuilder< T, Inserter >::CreateICmpUGE(), llvm::IRBuilder< T, Inserter >::CreateInsertElement(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateNeg(), llvm::IRBuilder< T, Inserter >::CreateOr(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateSExt(), llvm::IRBuilder< T, Inserter >::CreateSIToFP(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::IRBuilder< T, Inserter >::CreateTrunc(), llvm::IRBuilder< T, Inserter >::CreateUIToFP(), llvm::IRBuilderBase::CreateUnaryIntrinsic(), llvm::IRBuilder< T, Inserter >::CreateXor(), llvm::IRBuilder< T, Inserter >::CreateZExt(), DEBUG_TYPE, E, llvm::Instruction::eraseFromParent(), F(), llvm::Intrinsic::fabs, llvm::ConstantInt::get(), llvm::ConstantFP::get(), llvm::ConstantAsMetadata::get(), llvm::PointerType::get(), llvm::MDNode::get(), llvm::UndefValue::get(), llvm::Instruction::getDebugLoc(), llvm::IRBuilderBase::getFastMathFlags(), llvm::IRBuilderBase::getFloatTy(), llvm::IRBuilderBase::getInt32(), llvm::IRBuilderBase::getInt32Ty(), llvm::IRBuilderBase::getIntNTy(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getMetadata(), getMul64(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::LoadInst::getPointerAddressSpace(), llvm::LoadInst::getPointerOperand(), llvm::Type::getScalarSizeInBits(), llvm::TargetMachine::getSubtarget(), llvm::Value::getType(), llvm::ConstantInt::getValue(), hasUnsafeFPMath(), INITIALIZE_PASS_BEGIN(), INITIALIZE_PASS_DEPENDENCY, llvm::Type::isIntegerTy(), llvm::APInt::isNullValue(), LowAndHigh, llvm::Lower, llvm::LLVMContext::MD_range, llvm::Mod, N, llvm::AMDGPUISD::RCP, llvm::Value::replaceAllUsesWith(), runOnFunction(), llvm::IRBuilderBase::SetCurrentDebugLocation(), llvm::FastMathFlags::setFast(), llvm::IRBuilderBase::setFastMathFlags(), llvm::Instruction::setMetadata(), llvm::ARM_MB::ST, llvm::SystemZISD::TM, llvm::Intrinsic::trunc, and llvm::APInt::zext().
Definition at line 480 of file AMDGPUCodeGenPrepare.cpp.
References llvm::Function::getFnAttribute(), and llvm::Attribute::getValueAsString().
Referenced by getMulHu().
INITIALIZE_PASS_BEGIN | ( | AMDGPUCodeGenPrepare | , |
DEBUG_TYPE | , | ||
"AMDGPU IR optimizations" | , | ||
false | , | ||
false | |||
) |
Referenced by getMulHu().
|
static |
Definition at line 230 of file AMDGPUCodeGenPrepare.cpp.
References llvm::MCID::Add, llvm::Instruction::getOpcode(), and llvm::Instruction::hasNoUnsignedWrap().
Referenced by promotedOpIsNUW().
|
static |
Definition at line 244 of file AMDGPUCodeGenPrepare.cpp.
References llvm::MCID::Add, llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::Intrinsic::bitreverse, llvm::IRBuilder< T, Inserter >::CreateBinOp(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::IRBuilder< T, Inserter >::CreateLShr(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateSExt(), llvm::IRBuilder< T, Inserter >::CreateTrunc(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::Instruction::eraseFromParent(), llvm::DataLayout::getABITypeAlignment(), llvm::LoadInst::getAlignment(), llvm::Instruction::getDebugLoc(), llvm::Intrinsic::getDeclaration(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getOpcode(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::Instruction::hasNoUnsignedWrap(), llvm::CmpInst::isSigned(), llvm::LoadInst::isSimple(), llvm::Mod, promotedOpIsNSW(), llvm::Value::replaceAllUsesWith(), and llvm::IRBuilderBase::SetCurrentDebugLocation().
Definition at line 396 of file AMDGPUCodeGenPrepare.cpp.
References llvm::FastMathFlags::allowReciprocal(), llvm::Intrinsic::amdgcn_fdiv_fast, llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateExtractElement(), llvm::IRBuilder< T, Inserter >::CreateFDiv(), llvm::IRBuilder< T, Inserter >::CreateInsertElement(), llvm::dyn_cast(), E, llvm::Instruction::eraseFromParent(), llvm::UndefValue::get(), llvm::Instruction::getDebugLoc(), llvm::Intrinsic::getDeclaration(), llvm::FPMathOperator::getFastMathFlags(), llvm::FPMathOperator::getFPAccuracy(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getMetadata(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarType(), llvm::Value::getType(), I, llvm::ConstantFP::isExactlyValue(), llvm::FastMathFlags::isFast(), llvm::Type::isFloatTy(), llvm::LLVMContext::MD_fpmath, llvm::Mod, llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetCurrentDebugLocation(), llvm::IRBuilderBase::setFastMathFlags(), llvm::ARM_MB::ST, and llvm::Value::takeName().
DEBUG_TYPE |
Definition at line 920 of file AMDGPUCodeGenPrepare.cpp.
AMDGPU IR false |
Definition at line 920 of file AMDGPUCodeGenPrepare.cpp.
AMDGPU IR optimizations |
Definition at line 920 of file AMDGPUCodeGenPrepare.cpp.