30 #define DEBUG_TYPE "tti" 34 cl::desc(
"Recognize reduction patterns."));
52 if (containsIrreducibleCFG<const BasicBlock *>(RPOT, LI))
62 L->getExitingBlocks(ExitingBlocks);
67 if (!L->isLoopLatch(BB)) {
68 if (ForceHardwareLoopPHI || CounterInReg)
73 if (isa<SCEVCouldNotCompute>(EC))
75 if (
const SCEVConstant *ConstEC = dyn_cast<SCEVConstant>(EC)) {
76 if (ConstEC->getValue()->isZero())
97 bool NotAlways =
false;
99 if (!L->contains(Pred))
116 if (
BranchInst *BI = dyn_cast<BranchInst>(TI)) {
117 if (!BI->isConditional())
137 : TTIImpl(new
Model<NoTTIImpl>(NoTTIImpl(DL))) {}
142 : TTIImpl(
std::move(
Arg.TTIImpl)) {}
145 TTIImpl = std::move(RHS.TTIImpl);
151 int Cost = TTIImpl->getOperationCost(Opcode, Ty, OpTy);
152 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
157 const User *U)
const {
158 int Cost = TTIImpl->getCallCost(FTy, NumArgs, U);
159 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
165 const User *U)
const {
166 int Cost = TTIImpl->getCallCost(F, Arguments, U);
167 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
172 return TTIImpl->getInliningThresholdMultiplier();
176 return TTIImpl->getInlinerVectorBonusPercent();
181 return TTIImpl->getGEPCost(PointeeType, Ptr, Operands);
185 const Value *Src)
const {
186 return TTIImpl->getExtCost(I, Src);
191 const User *U)
const {
192 int Cost = TTIImpl->getIntrinsicCost(IID, RetTy, Arguments, U);
193 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
201 return TTIImpl->getEstimatedNumberOfCaseClusters(SI, JTSize, PSI, BFI);
206 int Cost = TTIImpl->getUserCost(U, Operands);
207 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
212 return TTIImpl->hasBranchDivergence();
216 return TTIImpl->isSourceOfDivergence(V);
220 return TTIImpl->isAlwaysUniform(V);
224 return TTIImpl->getFlatAddressSpace();
229 return TTIImpl->collectFlatAddressOperands(OpIndexes, IID);
234 return TTIImpl->rewriteIntrinsicWithAddressSpace(II, OldV, NewV);
238 return TTIImpl->isLoweredToCall(F);
244 return TTIImpl->isHardwareLoopProfitable(L, SE, AC, LibInfo, HWLoopInfo);
250 return TTIImpl->preferPredicateOverEpilogue(L, LI, SE, AC, TLI, DT, LAI);
255 return TTIImpl->getUnrollingPreferences(L, SE, UP);
259 return TTIImpl->isLegalAddImmediate(Imm);
263 return TTIImpl->isLegalICmpImmediate(Imm);
272 return TTIImpl->isLegalAddressingMode(Ty, BaseGV, BaseOffset, HasBaseReg,
273 Scale, AddrSpace, I);
277 return TTIImpl->isLSRCostLess(C1, C2);
281 return TTIImpl->canMacroFuseCmp();
288 return TTIImpl->canSaveCmp(L, BI, SE, LI, DT, AC, LibInfo);
292 return TTIImpl->shouldFavorPostInc();
296 return TTIImpl->shouldFavorBackedgeIndex(L);
301 return TTIImpl->isLegalMaskedStore(DataType, Alignment);
306 return TTIImpl->isLegalMaskedLoad(DataType, Alignment);
310 Align Alignment)
const {
311 return TTIImpl->isLegalNTStore(DataType, Alignment);
315 return TTIImpl->isLegalNTLoad(DataType, Alignment);
320 return TTIImpl->isLegalMaskedGather(DataType, Alignment);
325 return TTIImpl->isLegalMaskedScatter(DataType, Alignment);
329 return TTIImpl->isLegalMaskedCompressStore(DataType);
333 return TTIImpl->isLegalMaskedExpandLoad(DataType);
337 return TTIImpl->hasDivRemOp(DataType, IsSigned);
341 unsigned AddrSpace)
const {
342 return TTIImpl->hasVolatileVariant(I, AddrSpace);
346 return TTIImpl->prefersVectorizedAddressing();
353 unsigned AddrSpace)
const {
354 int Cost = TTIImpl->getScalingFactorCost(Ty, BaseGV, BaseOffset, HasBaseReg,
356 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
361 return TTIImpl->LSRWithInstrQueries();
365 return TTIImpl->isTruncateFree(Ty1, Ty2);
369 return TTIImpl->isProfitableToHoist(I);
375 return TTIImpl->isTypeLegal(Ty);
379 return TTIImpl->shouldBuildLookupTables();
382 return TTIImpl->shouldBuildLookupTablesForConstant(C);
386 return TTIImpl->useColdCCForColdCall(F);
391 return TTIImpl->getScalarizationOverhead(Ty, Insert, Extract);
397 return TTIImpl->getOperandsScalarizationOverhead(Args, VF);
401 return TTIImpl->supportsEfficientVectorElementLoadStore();
405 return TTIImpl->enableAggressiveInterleaving(LoopHasReductions);
410 return TTIImpl->enableMemCmpExpansion(OptSize, IsZeroCmp);
414 return TTIImpl->enableInterleavedAccessVectorization();
418 return TTIImpl->enableMaskedInterleavedAccessVectorization();
422 return TTIImpl->isFPVectorizationPotentiallyUnsafe();
430 return TTIImpl->allowsMisalignedMemoryAccesses(Context, BitWidth, AddressSpace,
436 return TTIImpl->getPopcntSupport(IntTyWidthInBit);
440 return TTIImpl->haveFastSqrt(Ty);
444 return TTIImpl->isFCmpOrdCheaperThanFCmpZero(Ty);
448 int Cost = TTIImpl->getFPOpCost(Ty);
449 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
456 int Cost = TTIImpl->getIntImmCodeSizeCost(Opcode, Idx, Imm, Ty);
457 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
462 int Cost = TTIImpl->getIntImmCost(Imm, Ty);
463 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
469 int Cost = TTIImpl->getIntImmCostInst(Opcode, Idx, Imm, Ty);
470 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
476 int Cost = TTIImpl->getIntImmCostIntrin(IID, Idx, Imm, Ty);
477 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
482 return TTIImpl->getNumberOfRegisters(ClassID);
486 return TTIImpl->getRegisterClassForType(Vector, Ty);
490 return TTIImpl->getRegisterClassName(ClassID);
494 return TTIImpl->getRegisterBitWidth(Vector);
498 return TTIImpl->getMinVectorRegisterBitWidth();
502 return TTIImpl->shouldMaximizeVectorBandwidth(OptSize);
506 return TTIImpl->getMinimumVF(ElemWidth);
510 const Instruction &
I,
bool &AllowPromotionWithoutCommonHeader)
const {
511 return TTIImpl->shouldConsiderAddressTypePromotion(
512 I, AllowPromotionWithoutCommonHeader);
516 return TTIImpl->getCacheLineSize();
521 return TTIImpl->getCacheSize(Level);
526 return TTIImpl->getCacheAssociativity(Level);
530 return TTIImpl->getPrefetchDistance();
534 return TTIImpl->getMinPrefetchStride();
538 return TTIImpl->getMaxPrefetchIterationsAhead();
542 return TTIImpl->getMaxInterleaveFactor(VF);
550 if (
auto *CI = dyn_cast<ConstantInt>(V)) {
551 if (CI->getValue().isPowerOf2())
559 if (
auto *ShuffleInst = dyn_cast<ShuffleVectorInst>(V))
560 if (ShuffleInst->isZeroEltSplat())
567 if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V)) {
571 if (
auto *CI = dyn_cast<ConstantInt>(Splat))
572 if (CI->getValue().isPowerOf2())
574 }
else if (
auto *CDS = dyn_cast<ConstantDataSequential>(V)) {
576 for (
unsigned I = 0,
E = CDS->getNumElements();
I !=
E; ++
I) {
577 if (
auto *CI = dyn_cast<ConstantInt>(CDS->getElementAsConstant(
I)))
578 if (CI->getValue().isPowerOf2())
588 if (Splat && (isa<Argument>(Splat) || isa<GlobalValue>(Splat)))
599 int Cost = TTIImpl->getArithmeticInstrCost(
600 Opcode, Ty, Opd1Info, Opd2Info, Opd1PropInfo, Opd2PropInfo, Args, CxtI);
601 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
607 int Cost = TTIImpl->getShuffleCost(Kind, Ty, Index, SubTp);
608 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
615 "Opcode should reflect passed instruction.");
616 int Cost = TTIImpl->getCastInstrCost(Opcode, Dst, Src, I);
617 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
623 unsigned Index)
const {
624 int Cost = TTIImpl->getExtractWithExtendCost(Opcode, Dst, VecTy, Index);
625 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
630 int Cost = TTIImpl->getCFInstrCost(Opcode);
631 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
638 "Opcode should reflect passed instruction.");
639 int Cost = TTIImpl->getCmpSelInstrCost(Opcode, ValTy, CondTy, I);
640 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
645 unsigned Index)
const {
646 int Cost = TTIImpl->getVectorInstrCost(Opcode, Val, Index);
647 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
656 "Opcode should reflect passed instruction.");
657 int Cost = TTIImpl->getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, I);
658 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
666 TTIImpl->getMaskedMemoryOpCost(Opcode, Src, Alignment, AddressSpace);
667 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
672 Value *Ptr,
bool VariableMask,
673 unsigned Alignment)
const {
674 int Cost = TTIImpl->getGatherScatterOpCost(Opcode, DataTy, Ptr, VariableMask,
676 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
682 unsigned Alignment,
unsigned AddressSpace,
bool UseMaskForCond,
683 bool UseMaskForGaps)
const {
684 int Cost = TTIImpl->getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
685 Alignment, AddressSpace,
688 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
694 unsigned ScalarizationCostPassed)
const {
695 int Cost = TTIImpl->getIntrinsicInstrCost(ID, RetTy, Tys, FMF,
696 ScalarizationCostPassed);
697 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
703 int Cost = TTIImpl->getIntrinsicInstrCost(ID, RetTy, Args, FMF, VF);
704 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
710 int Cost = TTIImpl->getCallInstrCost(F, RetTy, Tys);
711 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
716 return TTIImpl->getNumberOfParts(Tp);
721 const SCEV *Ptr)
const {
722 int Cost = TTIImpl->getAddressComputationCost(Tp, SE, Ptr);
723 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
728 int Cost = TTIImpl->getMemcpyCost(I);
729 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
734 bool IsPairwiseForm)
const {
735 int Cost = TTIImpl->getArithmeticReductionCost(Opcode, Ty, IsPairwiseForm);
736 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
742 bool IsUnsigned)
const {
744 TTIImpl->getMinMaxReductionCost(Ty, CondTy, IsPairwiseForm, IsUnsigned);
745 assert(Cost >= 0 &&
"TTI should not produce negative costs!");
751 return TTIImpl->getCostOfKeepingLiveOverCall(Tys);
756 return TTIImpl->getTgtMemIntrinsic(Inst, Info);
760 return TTIImpl->getAtomicMemIntrinsicMaxElementSize();
765 return TTIImpl->getOrCreateResultFromMemIntrinsic(Inst, ExpectedType);
771 unsigned DestAlign)
const {
772 return TTIImpl->getMemcpyLoopLoweringType(Context, Length, SrcAlign,
778 unsigned RemainingBytes,
unsigned SrcAlign,
unsigned DestAlign)
const {
779 TTIImpl->getMemcpyLoopResidualLoweringType(OpsOut, Context, RemainingBytes,
780 SrcAlign, DestAlign);
785 return TTIImpl->areInlineCompatible(Caller, Callee);
791 return TTIImpl->areFunctionArgsABICompatible(Caller, Callee, Args);
796 return TTIImpl->isIndexedLoadLegal(Mode, Ty);
801 return TTIImpl->isIndexedStoreLegal(Mode, Ty);
805 return TTIImpl->getLoadStoreVecRegBitWidth(AS);
809 return TTIImpl->isLegalToVectorizeLoad(LI);
813 return TTIImpl->isLegalToVectorizeStore(SI);
817 unsigned ChainSizeInBytes,
unsigned Alignment,
unsigned AddrSpace)
const {
818 return TTIImpl->isLegalToVectorizeLoadChain(ChainSizeInBytes, Alignment,
823 unsigned ChainSizeInBytes,
unsigned Alignment,
unsigned AddrSpace)
const {
824 return TTIImpl->isLegalToVectorizeStoreChain(ChainSizeInBytes, Alignment,
830 unsigned ChainSizeInBytes,
832 return TTIImpl->getLoadVectorFactor(VF, LoadSize, ChainSizeInBytes, VecTy);
837 unsigned ChainSizeInBytes,
839 return TTIImpl->getStoreVectorFactor(VF, StoreSize, ChainSizeInBytes, VecTy);
844 return TTIImpl->useReductionIntrinsic(Opcode, Ty, Flags);
848 return TTIImpl->shouldExpandReduction(II);
852 return TTIImpl->getGISelRematGlobalCost();
855 int TargetTransformInfo::getInstructionLatency(
const Instruction *
I)
const {
856 return TTIImpl->getInstructionLatency(I);
863 if (!SI && Level == 0 && IsLeft)
872 for (
unsigned i = 0,
e = (1 << Level), val = !IsLeft; i !=
e; ++i, val += 2)
876 return Mask == ActualMask;
888 struct ReductionData {
889 ReductionData() =
delete;
891 : Opcode(Opcode), LHS(LHS), RHS(RHS),
Kind(Kind) {
892 assert(Kind != RK_None &&
"expected binary or min/max reduction only.");
895 Value *LHS =
nullptr;
896 Value *RHS =
nullptr;
898 bool hasSameData(ReductionData &RD)
const {
899 return Kind == RD.Kind && Opcode == RD.Opcode;
907 return ReductionData(RK_Arithmetic, I->
getOpcode(), L, R);
908 if (
auto *
SI = dyn_cast<SelectInst>(I)) {
915 auto *CI = cast<CmpInst>(
SI->getCondition());
916 return ReductionData(RK_MinMax, CI->getOpcode(), L, R);
920 auto *CI = cast<CmpInst>(
SI->getCondition());
921 return ReductionData(RK_UnsignedMinMax, CI->getOpcode(), L, R);
929 unsigned NumLevels) {
953 if (!Level && !RS && !LS)
959 Value *NextLevelOp =
nullptr;
960 if (NextLevelOpR && NextLevelOpL) {
962 if (NextLevelOpL != NextLevelOpR)
965 NextLevelOp = NextLevelOpL;
966 }
else if (Level == 0 && (NextLevelOpR || NextLevelOpL)) {
973 if (NextLevelOpL && NextLevelOpL != RD->RHS)
975 else if (NextLevelOpR && NextLevelOpR != RD->LHS)
978 NextLevelOp = NextLevelOpL ? RD->RHS : RD->LHS;
984 if (Level + 1 != NumLevels) {
987 if (!NextLevelRD || !RD->hasSameData(*NextLevelRD))
1002 if (++Level == NumLevels)
1011 unsigned &Opcode,
Type *&Ty) {
1030 Type *VecTy = RdxStart->getType();
1057 Opcode = RD->Opcode;
1063 static std::pair<Value *, ShuffleVectorInst *>
1067 if ((S = dyn_cast<ShuffleVectorInst>(L)))
1068 return std::make_pair(R, S);
1071 return std::make_pair(L, S);
1076 unsigned &Opcode,
Type *&Ty) {
1111 unsigned MaskStart = 1;
1114 unsigned NumVecElemsRemain = NumVecElems;
1115 while (NumVecElemsRemain - 1) {
1120 if (!RDLevel || !RDLevel->hasSameData(*RD))
1125 std::tie(NextRdxOp, Shuffle) =
1129 if (Shuffle ==
nullptr)
1135 for (
unsigned j = 0; j != MaskStart; ++j)
1136 ShuffleMask[j] = MaskStart + j;
1138 std::fill(&ShuffleMask[MaskStart], ShuffleMask.
end(), -1);
1141 if (ShuffleMask != Mask)
1145 NumVecElemsRemain /= 2;
1149 Opcode = RD->Opcode;
1154 int TargetTransformInfo::getInstructionThroughput(
const Instruction *I)
const {
1156 case Instruction::GetElementPtr:
1160 case Instruction::PHI:
1161 case Instruction::Br: {
1165 case Instruction::FAdd:
1166 case Instruction::Sub:
1167 case Instruction::FSub:
1168 case Instruction::Mul:
1169 case Instruction::FMul:
1170 case Instruction::UDiv:
1171 case Instruction::SDiv:
1172 case Instruction::FDiv:
1173 case Instruction::URem:
1174 case Instruction::SRem:
1175 case Instruction::FRem:
1176 case Instruction::Shl:
1177 case Instruction::LShr:
1178 case Instruction::AShr:
1179 case Instruction::And:
1180 case Instruction::Or:
1181 case Instruction::Xor: {
1190 case Instruction::FNeg: {
1205 case Instruction::ICmp:
1206 case Instruction::FCmp: {
1223 case Instruction::ZExt:
1224 case Instruction::SExt:
1225 case Instruction::FPToUI:
1226 case Instruction::FPToSI:
1227 case Instruction::FPExt:
1228 case Instruction::PtrToInt:
1229 case Instruction::IntToPtr:
1230 case Instruction::SIToFP:
1231 case Instruction::UIToFP:
1232 case Instruction::Trunc:
1233 case Instruction::FPTrunc:
1234 case Instruction::BitCast:
1235 case Instruction::AddrSpaceCast: {
1239 case Instruction::ExtractElement: {
1248 unsigned ReduxOpCode;
1259 case RK_UnsignedMinMax:
1275 case RK_UnsignedMinMax:
1286 case Instruction::InsertElement: {
1295 case Instruction::ExtractValue:
1297 case Instruction::ShuffleVector: {
1314 return TTIImpl->getShuffleCost(
SK_Reverse, Ty, 0,
nullptr);
1317 return TTIImpl->getShuffleCost(
SK_Select, Ty, 0,
nullptr);
1320 return TTIImpl->getShuffleCost(
SK_Transpose, Ty, 0,
nullptr);
1323 return TTIImpl->getShuffleCost(
SK_Broadcast, Ty, 0,
nullptr);
1335 if (
auto *FPMO = dyn_cast<FPMathOperator>(II))
1336 FMF = FPMO->getFastMathFlags();
1354 : TTICallback(
std::move(TTICallback)) {}
1358 return TTICallback(F);
1369 "Target Transform Information",
false,
true)
1372 void TargetTransformInfoWrapperPass::anchor() {}
1389 TTI = TIRA.
run(F, DummyFAM);
MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty > m_UMin(const LHS &L, const RHS &R)
Value * getValueOperand()
A parsed version of the target data layout string in and methods for querying it. ...
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
This class represents lattice values for constants.
const Value * getSplatValue(const Value *V)
Get splat value if the input is a splat vector or return nullptr.
Analysis providing profile information.
The main scalar evolution driver.
ImmutablePass * createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA)
Create an analysis pass wrapper around a TTI object.
bool isReverse() const
Return true if this shuffle swaps the order of elements from exactly one source vector.
A cache of @llvm.assume calls within a function.
Analysis pass providing the TargetTransformInfo.
This instruction constructs a fixed permutation of two input vectors.
uint64_t getTypeSizeInBits(Type *Ty) const
Return the size in bits of the specified type, for which isSCEVable must return true.
bool isLoopInvariant(const SCEV *S, const Loop *L)
Return true if the value of the given SCEV is unchanging in the specified loop.
An instruction for reading from memory.
MaxMin_match< FCmpInst, LHS, RHS, ufmax_pred_ty > m_UnordFMax(const LHS &L, const RHS &R)
Match an 'unordered' floating point maximum function.
bool isVectorTy() const
True if this is an instance of VectorType.
bool isSingleSource() const
Return true if this shuffle chooses elements from exactly one source vector without changing the leng...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
bool match(Val *V, const Pattern &P)
This class represents the LLVM 'select' instruction.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
static AnalysisKey * ID()
Returns an opaque, unique ID for this analysis type.
MaxMin_match< FCmpInst, LHS, RHS, ufmin_pred_ty > m_UnordFMin(const LHS &L, const RHS &R)
Match an 'unordered' floating point minimum function.
mir Rename Register Operands
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
Class to represent function types.
Type * getType() const
All values are typed, get the type of this value.
MaxMin_match< FCmpInst, LHS, RHS, ofmin_pred_ty > m_OrdFMin(const LHS &L, const RHS &R)
Match an 'ordered' floating point minimum function.
MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty > m_SMin(const LHS &L, const RHS &R)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const SCEV * getExitCount(const Loop *L, BasicBlock *ExitingBlock, ExitCountKind Kind=Exact)
Return the number of times the backedge executes before the given exit would be taken; if not exactly...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
An instruction for storing to memory.
void initializeTargetTransformInfoWrapperPassPass(PassRegistry &)
bool isSelect() const
Return true if this shuffle chooses elements from its source vectors without lane crossings and all o...
VectorType * getType() const
Overload to return most specific vector type.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Value * getOperand(unsigned i) const
Analysis containing CSE Info
static bool isExtractSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is an extract subvector mask.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
initializer< Ty > init(const Ty &Val)
This instruction inserts a single (scalar) element into a VectorType value.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty > m_UMax(const LHS &L, const RHS &R)
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
Conditional or Unconditional Branch instruction.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
bool isIdentity() const
Return true if this shuffle chooses elements from exactly one source vector without lane crossings an...
static cl::opt< bool > ForceNestedLoop("force-nested-hardware-loop", cl::Hidden, cl::init(false), cl::desc("Force allowance of nested hardware loops"))
AMDGPU Lower Kernel Arguments
TargetIRAnalysis()
Default construct a target IR analysis.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
class_match< BinaryOperator > m_BinOp()
Match an arbitrary binary operation and ignore it.
static cl::opt< bool > ForceHardwareLoopPHI("force-hardware-loop-phi", cl::Hidden, cl::init(false), cl::desc("Force hardware loop counter to be updated through a phi"))
Attributes of a target dependent hardware loop.
const Value * getCondition() const
This struct is a compact representation of a valid (non-zero power of two) alignment.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This is the shared class of boolean and integer constants.
ImmutablePass class - This class is used to provide information that does not need to be run...
Type * getType() const
Return the LLVM type of this SCEV expression.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool dominates(const Instruction *Def, const Use &U) const
Return true if Def dominates a use in User.
Module.h This file contains the declarations for the Module class.
static void getShuffleMask(const Constant *Mask, SmallVectorImpl< int > &Result)
Convert the input shuffle mask operand to a vector of integers.
Provides information about what library functions are available for the current target.
Drive the analysis of memory accesses in the loop.
bool changesLength() const
Return true if this shuffle returns a vector with a different number of elements than its source vect...
pred_range predecessors(BasicBlock *BB)
bool canAnalyze(LoopInfo &LI)
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
unsigned getVectorNumElements() const
bool isZeroEltSplat() const
Return true if all elements of this shuffle are the same value as the first element of exactly one so...
Class to represent vector types.
Class for arbitrary precision integers.
Result run(const Function &F, FunctionAnalysisManager &)
bool isTranspose() const
Return true if this shuffle transposes the elements of its inputs without changing the length of the ...
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
unsigned getAlignment() const
Return the alignment of the access that is being performed.
This class represents an analyzed expression in the program.
Represents a single loop in the control flow graph.
MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty > m_SMax(const LHS &L, const RHS &R)
iterator_range< value_op_iterator > operand_values()
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getAlignment() const
Return the alignment of the access that is being performed FIXME: Remove this function once transitio...
Wrapper class to LoopBlocksDFS that provides a standard begin()/end() interface for the DFS reverse p...
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TargetTransformInfo Result
MaxMin_match< FCmpInst, LHS, RHS, ofmax_pred_ty > m_OrdFMax(const LHS &L, const RHS &R)
Match an 'ordered' floating point maximum function.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
print Print MemDeps of function
Convenience struct for specifying and reasoning about fast-math flags.
A container for analyses that lazily runs them and caches their results.
void perform(LoopInfo *LI)
Traverse the loop blocks and store the DFS result.
bool isHardwareLoopCandidate(ScalarEvolution &SE, LoopInfo &LI, DominatorTree &DT, bool ForceNestedLoop=false, bool ForceHardwareLoopPHI=false)
VectorType * getType() const
Overload to return most specific vector type.
Information about a load/store intrinsic defined by the target.
A special type used by analysis passes to provide an address that identifies that particular analysis...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
A wrapper class for inspecting calls to intrinsic functions.
This class represents a constant integer value.