LLVM 17.0.0git
|
#include "AArch64TargetTransformInfo.h"
#include "AArch64ExpandImm.h"
#include "AArch64PerfectShuffle.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/BasicTTIImpl.h"
#include "llvm/CodeGen/CostTable.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsAArch64.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/InstCombine/InstCombiner.h"
#include "llvm/Transforms/Vectorize/LoopVectorizationLegality.h"
#include <algorithm>
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "aarch64tti" |
Variables | |
static cl::opt< bool > | EnableFalkorHWPFUnrollFix ("enable-falkor-hwpf-unroll-fix", cl::init(true), cl::Hidden) |
static cl::opt< unsigned > | SVEGatherOverhead ("sve-gather-overhead", cl::init(10), cl::Hidden) |
static cl::opt< unsigned > | SVEScatterOverhead ("sve-scatter-overhead", cl::init(10), cl::Hidden) |
TailFoldingKind | TailFoldingKindLoc |
cl::opt< TailFoldingKind, true, cl::parser< std::string > > | SVETailFolding ("sve-tail-folding", cl::desc("Control the use of vectorisation using tail-folding for SVE:" "\ndisabled No loop types will vectorize using tail-folding" "\ndefault Uses the default tail-folding settings for the target " "CPU" "\nall All legal loop types will vectorize using tail-folding" "\nsimple Use tail-folding for simple loops (not reductions or " "recurrences)" "\nreductions Use tail-folding for loops containing reductions" "\nrecurrences Use tail-folding for loops containing fixed order " "recurrences"), cl::location(TailFoldingKindLoc)) |
static cl::opt< bool > | EnableFixedwidthAutovecInStreamingMode ("enable-fixedwidth-autovec-in-streaming-mode", cl::init(false), cl::Hidden) |
static cl::opt< bool > | EnableScalableAutovecInStreamingMode ("enable-scalable-autovec-in-streaming-mode", cl::init(false), cl::Hidden) |
#define DEBUG_TYPE "aarch64tti" |
Definition at line 31 of file AArch64TargetTransformInfo.cpp.
|
static |
Definition at line 2693 of file AArch64TargetTransformInfo.cpp.
References llvm::dbgs(), llvm::LoadInst::getPointerOperand(), llvm::ScalarEvolution::getSCEV(), I, llvm::SCEVAddRecExpr::isAffine(), LLVM_DEBUG, llvm::Log2_32(), and llvm::TargetTransformInfo::UnrollingPreferences::MaxCount.
Referenced by llvm::AArch64TTIImpl::getUnrollingPreferences().
Definition at line 2544 of file AArch64TargetTransformInfo.cpp.
References SVEGatherOverhead, and SVEScatterOverhead.
Referenced by llvm::AArch64TTIImpl::getGatherScatterOpCost().
|
static |
Definition at line 627 of file AArch64TargetTransformInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::CallBase::getArgOperand(), llvm::User::getOperand(), llvm::Value::getType(), llvm::SmallVectorImpl< T >::insert(), processPhiNode(), llvm::InstCombiner::replaceInstUsesWith(), and tryCombineFromSVBoolBinOp().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1340 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::ConstantAggregateZero::get(), llvm::Value::getContext(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::PatternMatch::m_SpecificInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), Ptr, llvm::InstCombiner::replaceInstUsesWith(), and llvm::Value::takeName().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1532 of file AArch64TargetTransformInfo.cpp.
References A, B, llvm::CallBase::getArgOperand(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 939 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::ConstantInt::get(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Value::getType(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1373 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::InstCombiner::eraseInstFromFunction(), llvm::Value::getContext(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::PatternMatch::m_SpecificInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and Ptr.
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 718 of file AArch64TargetTransformInfo.cpp.
References Arg, Builder, llvm::ScalableVectorType::get(), llvm::ConstantInt::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), llvm::Constant::getNullValue(), llvm::getSplatValue(), llvm::Value::getType(), I, llvm::InstCombiner::replaceInstUsesWith(), and llvm::AArch64::SVEBitsPerBlock.
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 957 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::ConstantInt::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::getNumElementsFromSVEPredPattern(), llvm::Value::getType(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 895 of file AArch64TargetTransformInfo.cpp.
References Builder, Fallback, llvm::VectorType::get(), llvm::CallBase::getArgOperand(), getBitWidth(), llvm::Value::getContext(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 682 of file AArch64TargetTransformInfo.cpp.
References llvm::InsertElementInst::Create(), llvm::ConstantInt::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt64Ty(), llvm::IntrinsicInst::getIntrinsicID(), llvm::User::getOperand(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1468 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Default, llvm::ScalableVectorType::get(), llvm::PoisonValue::get(), llvm::ConstantAggregateZero::get(), llvm::ConstantInt::get(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::Value::getType(), I, Idx, llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::InstCombiner::replaceInstUsesWith(), SimplifyValuePattern(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 706 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Value::getType(), llvm::InstCombiner::replaceInstUsesWith(), RetTy, and llvm::Value::takeName().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 819 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::CallingConv::C, llvm::ExtractElementInst::Create(), llvm::BinaryOperator::CreateWithCopiedFlags(), llvm::ConstantInt::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt64Ty(), llvm::IntrinsicInst::getIntrinsicID(), llvm::getNumElementsFromSVEPredPattern(), llvm::getSplatValue(), llvm::Value::getType(), Idx, llvm::isSplatValue(), LHS, llvm::PatternMatch::m_BinOp(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::InstCombiner::replaceInstUsesWith(), and RHS.
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1114 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Instruction::copyMetadata(), DL, llvm::ConstantAggregateZero::get(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::Value::getPointerAlignment(), llvm::Type::getPointerTo(), llvm::Value::getType(), isAllActivePredicate(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 979 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Value::getType(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1405 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::ConstantInt::get(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::getSplatValue(), llvm::Value::getType(), llvm::ConstantInt::getValue(), Int32Ty, llvm::APInt::isNegatedPowerOf2(), llvm::APInt::isPowerOf2(), llvm::APInt::logBase2(), llvm::APInt::negate(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 674 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::User::getOperand(), llvm::InstCombiner::replaceInstUsesWith(), and Select.
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1542 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::User::getOperand(), llvm::Value::getType(), isAllActivePredicate(), llvm::PatternMatch::m_NonNegative(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1137 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Instruction::copyMetadata(), DL, llvm::InstCombiner::eraseInstFromFunction(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::Value::getPointerAlignment(), llvm::Type::getPointerTo(), llvm::Value::getType(), and isAllActivePredicate().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1299 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Value::getContext(), llvm::User::getOperand(), llvm::getSplatValue(), llvm::Value::getType(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1277 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::IntrinsicInst::getIntrinsicID(), llvm::getSplatValue(), llvm::Value::getType(), llvm::InstCombiner::replaceInstUsesWith(), RetTy, and llvm::Value::takeName().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1188 of file AArch64TargetTransformInfo.cpp.
References instCombineSVEVectorBinOp(), and instCombineSVEVectorFuseMulAddSub().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1173 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Value::getContext(), llvm::Instruction::getFastMathFlags(), llvm::IntrinsicInst::getIntrinsicID(), llvm::User::getOperand(), intrinsicIDToBinOpCode(), llvm::PatternMatch::match(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by instCombineSVEVectorAdd(), instCombineSVEVectorMul(), and instCombineSVEVectorSub().
|
static |
Definition at line 1052 of file AArch64TargetTransformInfo.cpp.
References llvm::FastMathFlags::allowContract(), Builder, llvm::Value::getContext(), llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isFPOrFPVectorTy(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Mul, P, and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic(), instCombineSVEVectorAdd(), and instCombineSVEVectorSub().
|
static |
Definition at line 1230 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Value::getContext(), llvm::User::getOperand(), llvm::getSplatValue(), I, instCombineSVEVectorBinOp(), llvm::PatternMatch::m_FPOne(), llvm::PatternMatch::m_One(), llvm::PatternMatch::match(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1211 of file AArch64TargetTransformInfo.cpp.
References instCombineSVEVectorBinOp(), and instCombineSVEVectorFuseMulAddSub().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1324 of file AArch64TargetTransformInfo.cpp.
References A, B, llvm::CallBase::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::AArch64TTIImpl::instCombineIntrinsic().
|
static |
Definition at line 1159 of file AArch64TargetTransformInfo.cpp.
Referenced by instCombineSVEVectorBinOp().
Definition at line 1097 of file AArch64TargetTransformInfo.cpp.
References llvm::Value::getType(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
|
static |
The function will remove redundant reinterprets casting in the presence of the control flow.
Definition at line 527 of file AArch64TargetTransformInfo.cpp.
References llvm::PHINode::addIncoming(), assert(), Builder, llvm::CallBase::getArgOperand(), llvm::Value::getType(), I, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by instCombineConvertFromSVBool().
bool SimplifyValuePattern | ( | SmallVector< Value * > & | Vec, |
bool | AllowPoison | ||
) |
Definition at line 1439 of file AArch64TargetTransformInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::isPowerOf2_64(), LHS, llvm::SmallVectorImpl< T >::resize(), RHS, SimplifyValuePattern(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by instCombineSVEDupqLane(), and SimplifyValuePattern().
|
static |
Definition at line 575 of file AArch64TargetTransformInfo.cpp.
References Builder, llvm::Value::getContext(), llvm::User::getOperand(), llvm::Value::getType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by instCombineConvertFromSVBool().
|
static |
Referenced by llvm::AArch64TTIImpl::getUnrollingPreferences().
|
static |
Referenced by llvm::AArch64TTIImpl::getRegisterBitWidth().
|
static |
Referenced by llvm::AArch64TTIImpl::getRegisterBitWidth().
|
static |
Referenced by getSVEGatherScatterOverhead().
|
static |
Referenced by getSVEGatherScatterOverhead().
cl::opt< TailFoldingKind, true, cl::parser< std::string > > SVETailFolding("sve-tail-folding", cl::desc( "Control the use of vectorisation using tail-folding for SVE:" "\ndisabled No loop types will vectorize using tail-folding" "\ndefault Uses the default tail-folding settings for the target " "CPU" "\nall All legal loop types will vectorize using tail-folding" "\nsimple Use tail-folding for simple loops (not reductions or " "recurrences)" "\nreductions Use tail-folding for loops containing reductions" "\nrecurrences Use tail-folding for loops containing fixed order " "recurrences"), cl::location(TailFoldingKindLoc)) | ( | "sve-tail-folding" | , |
cl::desc( "Control the use of vectorisation using tail-folding for SVE:" "\ndisabled No loop types will vectorize using tail-folding" "\ndefault Uses the default tail-folding settings for the target " "CPU" "\nall All legal loop types will vectorize using tail-folding" "\nsimple Use tail-folding for simple loops (not reductions or " "recurrences)" "\nreductions Use tail-folding for loops containing reductions" "\nrecurrences Use tail-folding for loops containing fixed order " "recurrences") | , | ||
cl::location(TailFoldingKindLoc) | |||
) |
TailFoldingKind TailFoldingKindLoc |
Definition at line 95 of file AArch64TargetTransformInfo.cpp.
Referenced by llvm::AArch64TTIImpl::preferPredicateOverEpilogue().