|
LLVM
7.0.0
|
This pass inserts intrinsics to handle small types that would otherwise be promoted during legalization. More...
#include "ARM.h"#include "ARMSubtarget.h"#include "ARMTargetMachine.h"#include "llvm/ADT/StringRef.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/TargetPassConfig.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Constants.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/Type.h"#include "llvm/IR/Value.h"#include "llvm/IR/Verifier.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "arm-codegenprepare" |
Functions | |
| static bool | isSigned (Value *V) |
| Can the given value generate sign bits. More... | |
| static bool | isSupportedType (Value *V) |
| Some instructions can use 8- and 16-bit operands, and we don't need to promote anything larger. More... | |
| static bool | isSink (Value *V) |
| Return true if V will require any promoted values to be truncated for the use to be valid. More... | |
| static bool | isSource (Value *V) |
| Return true if the given value is a leaf that will need to be zext'd. More... | |
| static bool | isSafeOverflow (Instruction *I) |
| Return whether the instruction can be promoted within any modifications to it's operands or result. More... | |
| static bool | shouldPromote (Value *V) |
| static bool | isPromotedResultSafe (Value *V) |
| Return whether we can safely mutate V's type to ExtTy without having to be concerned with zero extending or truncation. More... | |
| static Intrinsic::ID | getNarrowIntrinsic (Instruction *I, unsigned TypeSize) |
| Return the intrinsic for the instruction that can perform the same operation but on a narrow type. More... | |
| INITIALIZE_PASS_BEGIN (ARMCodeGenPrepare, DEBUG_TYPE, "ARM IR optimizations", false, false) INITIALIZE_PASS_END(ARMCodeGenPrepare | |
Variables | |
| static cl::opt< bool > | DisableCGP ("arm-disable-cgp", cl::Hidden, cl::init(true), cl::desc("Disable ARM specific CodeGenPrepare pass")) |
| static cl::opt< bool > | EnableDSP ("arm-enable-scalar-dsp", cl::Hidden, cl::init(false), cl::desc("Use DSP instructions for scalar operations")) |
| static cl::opt< bool > | EnableDSPWithImms ("arm-enable-scalar-dsp-imms", cl::Hidden, cl::init(false), cl::desc("Use DSP instructions for scalar operations\ with immediate operands")) |
| DEBUG_TYPE | |
| ARM IR | optimizations |
| ARM IR | false |
This pass inserts intrinsics to handle small types that would otherwise be promoted during legalization.
Here we can manually promote types or insert intrinsics which can handle narrow types that aren't supported by the register classes.
Definition in file ARMCodeGenPrepare.cpp.
| #define DEBUG_TYPE "arm-codegenprepare" |
Definition at line 40 of file ARMCodeGenPrepare.cpp.
Referenced by getNarrowIntrinsic().
|
static |
Return the intrinsic for the instruction that can perform the same operation but on a narrow type.
This is using the parallel dsp intrinsics on scalar values.
Definition at line 265 of file ARMCodeGenPrepare.cpp.
References llvm::MCID::Add, Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::SetVector< T, Vector, Set >::back(), llvm::SmallPtrSetImplBase::clear(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), DEBUG_TYPE, DisableCGP, llvm::Value::dump(), llvm::dyn_cast(), llvm::SetVector< T, Vector, Set >::empty(), EnableDSP, EnableDSPWithImms, F(), llvm::ConstantInt::get(), llvm::Module::getContext(), llvm::Intrinsic::getDeclaration(), llvm::BasicBlock::getFirstInsertionPt(), llvm::Function::getFunctionType(), llvm::Type::getInt16Ty(), llvm::Type::getInt32Ty(), llvm::Value::getName(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::APInt::getRawData(), llvm::FunctionType::getReturnType(), llvm::ConstantExpr::getSExt(), llvm::TargetMachine::getSubtarget(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantExpr::getZExt(), I, INITIALIZE_PASS_BEGIN(), llvm::SetVector< T, Vector, Set >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isLegalToPromote(), llvm::ConstantInt::isNegative(), isPromotedResultSafe(), isSafeOverflow(), isSigned(), isSink(), isSource(), isSupportedType(), LLVM_DEBUG, llvm_unreachable, llvm::User::operands(), llvm::SetVector< T, Vector, Set >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::report_fatal_error(), runOnFunction(), shouldPromote(), llvm::ARM_MB::ST, llvm::SPII::Store, llvm::SystemZISD::TM, Users, llvm::Value::uses(), and llvm::verifyFunction().
| INITIALIZE_PASS_BEGIN | ( | ARMCodeGenPrepare | , |
| DEBUG_TYPE | , | ||
| "ARM IR optimizations" | , | ||
| false | , | ||
| false | |||
| ) |
Referenced by getNarrowIntrinsic().
Return whether we can safely mutate V's type to ExtTy without having to be concerned with zero extending or truncation.
Definition at line 244 of file ARMCodeGenPrepare.cpp.
References I, isSafeOverflow(), isSigned(), and isSink().
Referenced by getNarrowIntrinsic().
|
static |
Return whether the instruction can be promoted within any modifications to it's operands or result.
Definition at line 187 of file ARMCodeGenPrepare.cpp.
References llvm::MCID::Add, llvm::dbgs(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), LLVM_DEBUG, llvm::User::operands(), and llvm::Value::user_begin().
Referenced by getNarrowIntrinsic(), and isPromotedResultSafe().
Can the given value generate sign bits.
Definition at line 115 of file ARMCodeGenPrepare.cpp.
Referenced by llvm::APInt::APInt(), llvm::AVRDAGToDAGISel::select< ISD::BRIND >(), llvm::CastInst::CastInst(), changeFCMPPredToAArch64CC(), llvm::detail::IEEEFloat::convert(), llvm::detail::IEEEFloat::convertToInteger(), llvm::APInt::countPopulation(), decomposeSimpleLinearExpr(), ExpandBVWithShuffles(), llvm::ConstantInt::get(), getComparePred(), llvm::ScalarEvolution::getContext(), llvm::DAGTypeLegalizer::getDAG(), getDigit(), getDivRemArgList(), getDivRemLibcall(), llvm::ConstantExpr::getExactLShr(), getExpandedMinMaxOps(), llvm::APSInt::getExtValue(), GetFPLibCall(), llvm::BPFTargetLowering::getHasJmpExt(), llvm::X86TargetLowering::getMaxSupportedInterleaveFactor(), llvm::HexagonInstrInfo::getMaxValue(), llvm::HexagonInstrInfo::getMinValue(), getNarrowIntrinsic(), llvm::BPFTargetLowering::getTargetNodeName(), isDivRemLibcallAvailable(), llvm::CmpInst::isFalseWhenEqual(), llvm::ARMBaseRegisterInfo::isFrameOffsetLegal(), isFusableLoadOpStorePattern(), isPerfectIncrement(), isPromotedResultSafe(), llvm::CmpInst::isSigned(), llvm::TargetLowering::LowerCustomJumpTableEntry(), LowerMULH(), LowerUMULO_SMULO(), llvm::TargetLowering::makeLibCall(), PerformVCVTCombine(), PerformVDIVCombine(), promotedOpIsNUW(), llvm::DAGTypeLegalizer::run(), SimplifyBSwap(), simplifyDivRem(), llvm::APSInt::toString(), and TypeSizeToSizeIndex().
Return true if V will require any promoted values to be truncated for the use to be valid.
Definition at line 148 of file ARMCodeGenPrepare.cpp.
References llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::MCID::Return, and llvm::SPII::Store.
Referenced by getNarrowIntrinsic(), and isPromotedResultSafe().
Return true if the given value is a leaf that will need to be zext'd.
Definition at line 162 of file ARMCodeGenPrepare.cpp.
References isSupportedType(), and llvm::SPII::Load.
Referenced by getNarrowIntrinsic().
Some instructions can use 8- and 16-bit operands, and we don't need to promote anything larger.
We disallow booleans to make life easier when dealing with icmps but allow any other integer that is <= 16 bits. Void types are accepted so we can handle switches.
Definition at line 128 of file ARMCodeGenPrepare.cpp.
References llvm::dyn_cast(), llvm::IntegerType::getBitWidth(), llvm::Value::getType(), and llvm::Type::isVoidTy().
Referenced by getNarrowIntrinsic(), and isSource().
Definition at line 224 of file ARMCodeGenPrepare.cpp.
References llvm::dyn_cast(), llvm::Value::getType(), and I.
Referenced by getNarrowIntrinsic().
| DEBUG_TYPE |
Definition at line 743 of file ARMCodeGenPrepare.cpp.
|
static |
Referenced by getNarrowIntrinsic().
|
static |
Referenced by getNarrowIntrinsic().
|
static |
Referenced by getNarrowIntrinsic().
| ARM IR false |
Definition at line 743 of file ARMCodeGenPrepare.cpp.
| ARM IR optimizations |
Definition at line 743 of file ARMCodeGenPrepare.cpp.
1.8.13