diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -24,6 +24,7 @@ #include "llvm/ADT/SmallBitVector.h" #include "llvm/IR/FMF.h" #include "llvm/IR/InstrTypes.h" +#include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include "llvm/Support/AtomicOrdering.h" @@ -282,12 +283,38 @@ TCC_Expensive = 4 ///< The cost of a 'div' instruction on x86. }; + /// A representation of a user of a GEP operation. + /// + /// If AccessType is nullptr, then the user isn't a memory op and the GEP + /// can't be folded. + /// + /// If AccessType is a type, then it will be passed to isLegalAddressingMode + /// to determine if the GEP can possibly be folded. + struct GEPUser { + Type *AccessType; + /// Create a user which accesses memory of type \p Ty. Useful when + /// estimating the cost of a GEP when its users haven't been created yet. + GEPUser(Type *Ty); + /// Create a user from an already existing Value and determine the type of + /// memory it accesses, if any. + GEPUser(const Value *User); + }; + /// Estimate the cost of a GEP operation when lowered. InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, - ArrayRef Operands, + ArrayRef Operands, ArrayRef Users, TargetCostKind CostKind = TCK_SizeAndLatency) const; + InstructionCost + getGEPCost(GetElementPtrInst *GEP, + TargetCostKind CostKind = TCK_SizeAndLatency) const { + SmallVector Users(GEP->users()); + SmallVector Ops(GEP->indices()); + return getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), + Ops, Users, CostKind); + } + /// Describe known properties for a set of pointers. struct PointersChainInfo { /// All the GEPs in a set have same base address. @@ -1666,6 +1693,7 @@ virtual const DataLayout &getDataLayout() const = 0; virtual InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands, + ArrayRef Users, TTI::TargetCostKind CostKind) = 0; virtual InstructionCost getPointersChainCost(ArrayRef Ptrs, const Value *Base, @@ -2023,9 +2051,9 @@ InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, - ArrayRef Operands, + ArrayRef Operands, ArrayRef Users, TargetTransformInfo::TargetCostKind CostKind) override { - return Impl.getGEPCost(PointeeType, Ptr, Operands, CostKind); + return Impl.getGEPCost(PointeeType, Ptr, Operands, Users, CostKind); } InstructionCost getPointersChainCost(ArrayRef Ptrs, const Value *Base, diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h --- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -48,6 +48,7 @@ InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands, + ArrayRef Users, TTI::TargetCostKind CostKind) const { // In the basic model, we just assume that all-constant GEPs will be folded // into their uses via addressing modes. @@ -977,6 +978,7 @@ InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands, + ArrayRef Users, TTI::TargetCostKind CostKind) { assert(PointeeType && Ptr && "can't get GEPCost of nullptr"); assert(cast(Ptr->getType()->getScalarType()) @@ -997,6 +999,15 @@ if (Operands.empty()) return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic; + // If the GEP would have all zero indices (and it's not using a global + // value), then it's just a type cast and is free. + if (all_of(Operands, [](const Value *Op) { + if (auto *CI = dyn_cast(Op)) + return CI->isZero(); + return isa(Op); + })) + return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic; + for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) { TargetType = GTI.getIndexedType(); // We assume that the cost of Scalar GEP with constant index and the @@ -1030,10 +1041,18 @@ } } - if (static_cast(this)->isLegalAddressingMode( - TargetType, const_cast(BaseGV), - BaseOffset.sextOrTrunc(64).getSExtValue(), HasBaseReg, Scale, - Ptr->getType()->getPointerAddressSpace())) + uint64_t BaseOffsetVal = BaseOffset.sextOrTrunc(64).getSExtValue(); + + // If all the users of this GEP are memory instructions where the GEP can be + // folded into them via a legal addressing mode, then it's free. + bool IsFoldable = all_of(Users, [&](auto &U) { + if (!U.AccessType) + return false; + return static_cast(this)->isLegalAddressingMode( + U.AccessType, const_cast(BaseGV), BaseOffsetVal, + HasBaseReg, Scale, Ptr->getType()->getPointerAddressSpace()); + }); + if (IsFoldable) return TTI::TCC_Free; return TTI::TCC_Basic; } @@ -1065,10 +1084,11 @@ {TTI::OK_AnyValue, TTI::OP_None}, {TTI::OK_AnyValue, TTI::OP_None}, std::nullopt); } else { - SmallVector Indices(GEP->indices()); + SmallVector Users(GEP->users()); + SmallVector Ops(GEP->indices()); Cost += static_cast(this)->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), - Indices, CostKind); + Ops, Users, CostKind); } } return Cost; @@ -1120,9 +1140,16 @@ break; case Instruction::GetElementPtr: { const auto *GEP = cast(U); - return TargetTTI->getGEPCost(GEP->getSourceElementType(), - GEP->getPointerOperand(), - Operands.drop_front(), CostKind); + SmallVector Users(GEP->users()); + + // Note: don't use the base pointer + indices from GEP->operands(), + // because the operands passed to getInstructionCost may differ from those + // actually on the instruction. + const Value *Ptr = Operands.front(); + ArrayRef Indices = Operands.drop_front(1); + + return TargetTTI->getGEPCost(GEP->getSourceElementType(), Ptr, Indices, + Users, CostKind); } case Instruction::Add: case Instruction::FAdd: diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -417,8 +417,9 @@ InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands, + ArrayRef Users, TTI::TargetCostKind CostKind) { - return BaseT::getGEPCost(PointeeType, Ptr, Operands, CostKind); + return BaseT::getGEPCost(PointeeType, Ptr, Operands, Users, CostKind); } unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI, diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -221,11 +221,43 @@ return TTIImpl->getInlinerVectorBonusPercent(); } -InstructionCost -TargetTransformInfo::getGEPCost(Type *PointeeType, const Value *Ptr, - ArrayRef Operands, - TTI::TargetCostKind CostKind) const { - return TTIImpl->getGEPCost(PointeeType, Ptr, Operands, CostKind); +TargetTransformInfo::GEPUser::GEPUser(Type *Ty) : AccessType(Ty) {} + +TargetTransformInfo::GEPUser::GEPUser(const Value *User) { + if (auto *L = dyn_cast(User)) + AccessType = L->getType(); + else if (auto *S = dyn_cast(User)) + AccessType = S->getValueOperand()->getType(); + else if (const IntrinsicInst *Intr = dyn_cast(User)) { + switch (Intr->getIntrinsicID()) { + case Intrinsic::masked_load: + case Intrinsic::masked_gather: + case Intrinsic::masked_expandload: + case Intrinsic::vp_load: + case Intrinsic::vp_gather: + case Intrinsic::experimental_vp_strided_load: + AccessType = Intr->getType(); + break; + case Intrinsic::masked_store: + case Intrinsic::masked_scatter: + case Intrinsic::masked_compressstore: + case Intrinsic::vp_store: + case Intrinsic::vp_scatter: + case Intrinsic::experimental_vp_strided_store: + AccessType = Intr->getOperand(0)->getType(); + break; + default: + AccessType = nullptr; + break; + } + } else + AccessType = nullptr; +} + +InstructionCost TargetTransformInfo::getGEPCost( + Type *PointeeType, const Value *Ptr, ArrayRef Operands, + ArrayRef Users, TTI::TargetCostKind CostKind) const { + return TTIImpl->getGEPCost(PointeeType, Ptr, Operands, Users, CostKind); } InstructionCost TargetTransformInfo::getPointersChainCost( diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -4951,9 +4951,10 @@ // into constants. X86 memory addressing allows encoding it into // displacement. So we just need to take the base GEP cost. if (const auto *BaseGEP = dyn_cast(Base)) { + SmallVector Users(BaseGEP->users()); SmallVector Indices(BaseGEP->indices()); return getGEPCost(BaseGEP->getSourceElementType(), - BaseGEP->getPointerOperand(), Indices, CostKind); + BaseGEP->getPointerOperand(), Indices, Users, CostKind); } return TTI::TCC_Free; } diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -1343,22 +1343,18 @@ static bool isFoldableInLoop(const Instruction &I, const Loop *CurLoop, const TargetTransformInfo *TTI) { if (auto *GEP = dyn_cast(&I)) { + // Account for only the users that are inside CurLoop. + SmallVector Users; + for (const Value *V : GEP->users()) + if (auto *I = dyn_cast(V)) + if (CurLoop->contains(I)) + Users.push_back(I); + + SmallVector Indices(GEP->indices()); InstructionCost CostI = - TTI->getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency); - if (CostI != TargetTransformInfo::TCC_Free) - return false; - // For a GEP, we cannot simply use getInstructionCost because currently - // it optimistically assumes that a GEP will fold into addressing mode - // regardless of its users. - const BasicBlock *BB = GEP->getParent(); - for (const User *U : GEP->users()) { - const Instruction *UI = cast(U); - if (CurLoop->contains(UI) && - (BB != UI->getParent() || - (!isa(UI) && !isa(UI)))) - return false; - } - return true; + TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), + Indices, Users, TTI::TCK_SizeAndLatency); + return CostI == TTI::TCC_Free; } return false; diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp --- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp +++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp @@ -327,9 +327,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP, const TargetTransformInfo *TTI) { - SmallVector Indices(GEP->indices()); - return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), - Indices) == TargetTransformInfo::TCC_Free; + return TTI->getGEPCost(GEP) == TargetTransformInfo::TCC_Free; } Instruction *NaryReassociatePass::tryReassociateGEP(GetElementPtrInst *GEP) { diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp --- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp @@ -284,9 +284,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP, const TargetTransformInfo *TTI) { - SmallVector Indices(GEP->indices()); - return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), - Indices) == TargetTransformInfo::TCC_Free; + return TTI->getGEPCost(GEP) == TargetTransformInfo::TCC_Free; } // Returns whether (Base + Index * Stride) can be folded to an addressing mode. diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -7364,9 +7364,6 @@ "Calculated GEPs cost for Tree")); return InstructionCost{TTI::TCC_Free}; } - VecCost = TTI->getPointersChainCost( - PtrsRetainedInVecCode, BasePtr, - TTI::PointersChainInfo::getKnownNonUniformStrided(), CostKind); } else { // Case 1: Ptrs are the arguments of loads that we are going to transform // into masked gather load intrinsic. @@ -7383,16 +7380,13 @@ : TTI::PointersChainInfo::getKnownNonUniformStrided(); ScalarCost = TTI->getPointersChainCost(Ptrs, BasePtr, PtrsInfo, CostKind); + } - // Remark: it not quite correct to use scalar GEP cost for a vector GEP, - // but it's not clear how to do that without having vector GEP arguments - // ready. - // Perhaps using just TTI::TCC_Free/TTI::TCC_Basic would be better option. - if (const auto *Base = dyn_cast(BasePtr)) { - SmallVector Indices(Base->indices()); - VecCost = TTI->getGEPCost(Base->getSourceElementType(), - Base->getPointerOperand(), Indices, CostKind); - } + if (auto *BaseGEP = dyn_cast(BasePtr)) { + SmallVector Indices(BaseGEP->indices()); + VecCost = TTI->getGEPCost(BaseGEP->getSourceElementType(), + BaseGEP->getPointerOperand(), Indices, {VecTy}, + CostKind); } LLVM_DEBUG(dumpTreeCosts(E, 0, VecCost, ScalarCost, diff --git a/llvm/test/Analysis/CostModel/AMDGPU/gep.ll b/llvm/test/Analysis/CostModel/AMDGPU/gep.ll --- a/llvm/test/Analysis/CostModel/AMDGPU/gep.ll +++ b/llvm/test/Analysis/CostModel/AMDGPU/gep.ll @@ -13,12 +13,16 @@ define void @test_geps() { ; ALL-LABEL: 'test_geps' ; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void ; ; ALL-SIZE-LABEL: 'test_geps' ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; @@ -29,9 +33,11 @@ ; dead code. ; This GEP has index INT64_MAX, which is cost 1. %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 + store volatile i8 undef, ptr %giant_gep0 ; This GEP index wraps around to -1, which is cost 0. %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 + store volatile i8 undef, ptr %giant_gep1 ret void } diff --git a/llvm/test/Analysis/CostModel/ARM/gep.ll b/llvm/test/Analysis/CostModel/ARM/gep.ll --- a/llvm/test/Analysis/CostModel/ARM/gep.ll +++ b/llvm/test/Analysis/CostModel/ARM/gep.ll @@ -12,97 +12,169 @@ define void @testi8(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testi8' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testi8' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testi8' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testi8' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testi8' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testi8' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testi8' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i8, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am4, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i8, ptr %a, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a31, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i8, ptr %a, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a32, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4095, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4096, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i8, ptr %a, i32 -255 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am255, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i8, ptr %a, i32 -256 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %am256, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds i8, ptr %a, i32 1 + store volatile i8 undef, ptr %a1 %am4 = getelementptr inbounds i8, ptr %a, i32 -1 + store volatile i8 undef, ptr %am4 %a31 = getelementptr inbounds i8, ptr %a, i32 31 + store volatile i8 undef, ptr %a31 %a32 = getelementptr inbounds i8, ptr %a, i32 32 + store volatile i8 undef, ptr %a32 %a4095 = getelementptr inbounds i8, ptr %a, i32 4095 + store volatile i8 undef, ptr %a4095 %a4096 = getelementptr inbounds i8, ptr %a, i32 4096 + store volatile i8 undef, ptr %a4096 %am255 = getelementptr inbounds i8, ptr %a, i32 -255 + store volatile i8 undef, ptr %am255 %am256 = getelementptr inbounds i8, ptr %a, i32 -256 + store volatile i8 undef, ptr %am256 %ai = getelementptr inbounds i8, ptr %a, i32 %i + store volatile i8 undef, ptr %ai ret void } @@ -110,97 +182,169 @@ define void @testi16(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testi16' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testi16' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testi16' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testi16' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testi16' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testi16' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testi16' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i16, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am4, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i16, ptr %a, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a31, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i16, ptr %a, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a32, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4095, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4096, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i16, ptr %a, i32 -127 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am255, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i16, ptr %a, i32 -128 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %am256, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds i16, ptr %a, i32 1 + store volatile i16 undef, ptr %a1 %am4 = getelementptr inbounds i16, ptr %a, i32 -1 + store volatile i16 undef, ptr %am4 %a31 = getelementptr inbounds i16, ptr %a, i32 31 + store volatile i16 undef, ptr %a31 %a32 = getelementptr inbounds i16, ptr %a, i32 32 + store volatile i16 undef, ptr %a32 %a4095 = getelementptr inbounds i16, ptr %a, i32 2046 + store volatile i16 undef, ptr %a4095 %a4096 = getelementptr inbounds i16, ptr %a, i32 2048 + store volatile i16 undef, ptr %a4096 %am255 = getelementptr inbounds i16, ptr %a, i32 -127 + store volatile i16 undef, ptr %am255 %am256 = getelementptr inbounds i16, ptr %a, i32 -128 + store volatile i16 undef, ptr %am256 %ai = getelementptr inbounds i16, ptr %a, i32 %i + store volatile i16 undef, ptr %ai ret void } @@ -208,97 +352,169 @@ define void @testi32(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testi32' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testi32' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testi32' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testi32' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testi32' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testi32' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testi32' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i32, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am4, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i32, ptr %a, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a31, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i32, ptr %a, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a32, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1023, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1024, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i32, ptr %a, i32 -63 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am255, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i32, ptr %a, i32 -64 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %am256, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds i32, ptr %a, i32 1 + store volatile i32 undef, ptr %a1 %am4 = getelementptr inbounds i32, ptr %a, i32 -1 + store volatile i32 undef, ptr %am4 %a31 = getelementptr inbounds i32, ptr %a, i32 31 + store volatile i32 undef, ptr %a31 %a32 = getelementptr inbounds i32, ptr %a, i32 32 + store volatile i32 undef, ptr %a32 %a1023 = getelementptr inbounds i32, ptr %a, i32 1023 + store volatile i32 undef, ptr %a1023 %a1024 = getelementptr inbounds i32, ptr %a, i32 1024 + store volatile i32 undef, ptr %a1024 %am255 = getelementptr inbounds i32, ptr %a, i32 -63 + store volatile i32 undef, ptr %am255 %am256 = getelementptr inbounds i32, ptr %a, i32 -64 + store volatile i32 undef, ptr %am256 %ai = getelementptr inbounds i32, ptr %a, i32 %i + store volatile i32 undef, ptr %ai ret void } @@ -306,113 +522,201 @@ define void @testi64(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testi64' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testi64' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testi64' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testi64' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testi64' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testi64' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testi64' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a1, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am4 = getelementptr inbounds i64, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am4, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a15 = getelementptr inbounds i64, ptr %a, i32 15 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a15, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a16 = getelementptr inbounds i64, ptr %a, i32 16 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a16, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a31 = getelementptr inbounds i64, ptr %a, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a31, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a32 = getelementptr inbounds i64, ptr %a, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a32, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4095, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %a4096, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds i64, ptr %a, i32 -63 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am255, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds i64, ptr %a, i32 -64 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %am256, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile i64 undef, ptr %ai, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds i64, ptr %a, i32 1 + store volatile i64 undef, ptr %a1 %am4 = getelementptr inbounds i64, ptr %a, i32 -1 + store volatile i64 undef, ptr %am4 %a15 = getelementptr inbounds i64, ptr %a, i32 15 + store volatile i64 undef, ptr %a15 %a16 = getelementptr inbounds i64, ptr %a, i32 16 + store volatile i64 undef, ptr %a16 %a31 = getelementptr inbounds i64, ptr %a, i32 31 + store volatile i64 undef, ptr %a31 %a32 = getelementptr inbounds i64, ptr %a, i32 32 + store volatile i64 undef, ptr %a32 %a4095 = getelementptr inbounds i64, ptr %a, i32 1023 + store volatile i64 undef, ptr %a4095 %a4096 = getelementptr inbounds i64, ptr %a, i32 1024 + store volatile i64 undef, ptr %a4096 %am255 = getelementptr inbounds i64, ptr %a, i32 -63 + store volatile i64 undef, ptr %am255 %am256 = getelementptr inbounds i64, ptr %a, i32 -64 + store volatile i64 undef, ptr %am256 %ai = getelementptr inbounds i64, ptr %a, i32 %i + store volatile i64 undef, ptr %ai ret void } @@ -420,113 +724,201 @@ define void @testhalf(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testhalf' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testhalf' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testhalf' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testhalf' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testhalf' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testhalf' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testhalf' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1 = getelementptr inbounds half, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds half, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am1, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds half, ptr %a, i32 255 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a255, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds half, ptr %a, i32 256 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a256, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds half, ptr %a, i32 -255 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am255, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds half, ptr %a, i32 -256 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am256, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds half, ptr %a, i32 1023 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1023, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds half, ptr %a, i32 1024 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %a1024, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds half, ptr %a, i32 -63 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am63, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds half, ptr %a, i32 -64 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %am64, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds half, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile half undef, ptr %ai, align 2 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds half, ptr %a, i32 1 + store volatile half undef, ptr %a1 %am1 = getelementptr inbounds half, ptr %a, i32 -1 + store volatile half undef, ptr %am1 %a255 = getelementptr inbounds half, ptr %a, i32 255 + store volatile half undef, ptr %a255 %a256 = getelementptr inbounds half, ptr %a, i32 256 + store volatile half undef, ptr %a256 %am255 = getelementptr inbounds half, ptr %a, i32 -255 + store volatile half undef, ptr %am255 %am256 = getelementptr inbounds half, ptr %a, i32 -256 + store volatile half undef, ptr %am256 %a1023 = getelementptr inbounds half, ptr %a, i32 1023 + store volatile half undef, ptr %a1023 %a1024 = getelementptr inbounds half, ptr %a, i32 1024 + store volatile half undef, ptr %a1024 %am63 = getelementptr inbounds half, ptr %a, i32 -63 + store volatile half undef, ptr %am63 %am64 = getelementptr inbounds half, ptr %a, i32 -64 + store volatile half undef, ptr %am64 %ai = getelementptr inbounds half, ptr %a, i32 %i + store volatile half undef, ptr %ai ret void } @@ -534,113 +926,201 @@ define void @testfloat(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testfloat' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testfloat' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testfloat' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testfloat' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testfloat' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testfloat' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testfloat' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds float, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am1, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds float, ptr %a, i32 255 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a255, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds float, ptr %a, i32 256 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a256, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds float, ptr %a, i32 -255 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am255, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds float, ptr %a, i32 -256 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am256, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds float, ptr %a, i32 1023 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1023, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds float, ptr %a, i32 1024 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1024, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds float, ptr %a, i32 -63 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am63, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds float, ptr %a, i32 -64 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %am64, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds float, ptr %a, i32 1 + store volatile float undef, ptr %a1 %am1 = getelementptr inbounds float, ptr %a, i32 -1 + store volatile float undef, ptr %am1 %a255 = getelementptr inbounds float, ptr %a, i32 255 + store volatile float undef, ptr %a255 %a256 = getelementptr inbounds float, ptr %a, i32 256 + store volatile float undef, ptr %a256 %am255 = getelementptr inbounds float, ptr %a, i32 -255 + store volatile float undef, ptr %am255 %am256 = getelementptr inbounds float, ptr %a, i32 -256 + store volatile float undef, ptr %am256 %a1023 = getelementptr inbounds float, ptr %a, i32 1023 + store volatile float undef, ptr %a1023 %a1024 = getelementptr inbounds float, ptr %a, i32 1024 + store volatile float undef, ptr %a1024 %am63 = getelementptr inbounds float, ptr %a, i32 -63 + store volatile float undef, ptr %am63 %am64 = getelementptr inbounds float, ptr %a, i32 -64 + store volatile float undef, ptr %am64 %ai = getelementptr inbounds float, ptr %a, i32 %i + store volatile float undef, ptr %ai ret void } @@ -648,113 +1128,201 @@ define void @testdouble(ptr %a, i32 %i) { ; CHECK-V6M-LABEL: 'testdouble' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testdouble' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testdouble' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testdouble' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testdouble' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testdouble' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testdouble' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am1 = getelementptr inbounds double, ptr %a, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am1, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a255 = getelementptr inbounds double, ptr %a, i32 127 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a255, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a256 = getelementptr inbounds double, ptr %a, i32 128 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a256, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am255 = getelementptr inbounds double, ptr %a, i32 -127 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am255, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %am256 = getelementptr inbounds double, ptr %a, i32 -128 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am256, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1023 = getelementptr inbounds double, ptr %a, i32 511 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1023, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a1024 = getelementptr inbounds double, ptr %a, i32 512 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1024, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am63 = getelementptr inbounds double, ptr %a, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am63, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %am64 = getelementptr inbounds double, ptr %a, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %am64, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %a1 = getelementptr inbounds double, ptr %a, i32 1 + store volatile double undef, ptr %a1 %am1 = getelementptr inbounds double, ptr %a, i32 -1 + store volatile double undef, ptr %am1 %a255 = getelementptr inbounds double, ptr %a, i32 127 + store volatile double undef, ptr %a255 %a256 = getelementptr inbounds double, ptr %a, i32 128 + store volatile double undef, ptr %a256 %am255 = getelementptr inbounds double, ptr %a, i32 -127 + store volatile double undef, ptr %am255 %am256 = getelementptr inbounds double, ptr %a, i32 -128 + store volatile double undef, ptr %am256 %a1023 = getelementptr inbounds double, ptr %a, i32 511 + store volatile double undef, ptr %a1023 %a1024 = getelementptr inbounds double, ptr %a, i32 512 + store volatile double undef, ptr %a1024 %am63 = getelementptr inbounds double, ptr %a, i32 -31 + store volatile double undef, ptr %am63 %am64 = getelementptr inbounds double, ptr %a, i32 -32 + store volatile double undef, ptr %am64 %ai = getelementptr inbounds double, ptr %a, i32 %i + store volatile double undef, ptr %ai ret void } @@ -762,433 +1330,833 @@ define void @testvecs(i32 %i) { ; CHECK-V6M-LABEL: 'testvecs' ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-V6M-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-NOFP-LABEL: 'testvecs' ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-V7M-NOFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-V7M-FP-LABEL: 'testvecs' ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-V7M-FP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; CHECK-MVE-LABEL: 'testvecs' ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-MVE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-MVEFP-LABEL: 'testvecs' ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 10 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-MVEFP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-T32-LABEL: 'testvecs' ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-T32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; CHECK-A32-LABEL: 'testvecs' ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %b7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %b8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %b9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %b10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %b11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %b12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %b13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %o7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %o8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %o9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %o10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %o11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %o12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %o13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %p7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %p8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %p9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %p10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %p11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %p12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %p13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %q7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %q8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %q9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %q10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %q11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %q12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %q13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %r7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %r8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %r9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %r10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %r11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %r12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %r13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %s7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %s8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %s9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %s10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %s11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %s12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %s13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 13 for instruction: store volatile <4 x i8> undef, ptr %c7, align 4 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %c8, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %c9, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %c10, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store volatile <4 x half> undef, ptr %c11, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %c12, align 8 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 8 for instruction: store volatile <4 x double> undef, ptr %c13, align 32 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %d0 = getelementptr inbounds i8, ptr undef, i32 -1 +; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %d0, align 1 ; CHECK-A32-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; %b7 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 + store volatile <4 x i8> undef, ptr %b7 %b8 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 + store volatile <4 x i16> undef, ptr %b8 %b9 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 + store volatile <4 x i32> undef, ptr %b9 %b10 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 + store volatile <4 x i64> undef, ptr %b10 %b11 = getelementptr inbounds <4 x half>, ptr undef, i32 1 + store volatile <4 x half> undef, ptr %b11 %b12 = getelementptr inbounds <4 x float>, ptr undef, i32 1 + store volatile <4 x float> undef, ptr %b12 %b13 = getelementptr inbounds <4 x double>, ptr undef, i32 1 + store volatile <4 x double> undef, ptr %b13 %o7 = getelementptr inbounds <4 x i8>, ptr undef, i32 4 + store volatile <4 x i8> undef, ptr %o7 %o8 = getelementptr inbounds <4 x i16>, ptr undef, i32 4 + store volatile <4 x i16> undef, ptr %o8 %o9 = getelementptr inbounds <4 x i32>, ptr undef, i32 4 + store volatile <4 x i32> undef, ptr %o9 %o10 = getelementptr inbounds <4 x i64>, ptr undef, i32 4 + store volatile <4 x i64> undef, ptr %o10 %o11 = getelementptr inbounds <4 x half>, ptr undef, i32 4 + store volatile <4 x half> undef, ptr %o11 %o12 = getelementptr inbounds <4 x float>, ptr undef, i32 4 + store volatile <4 x float> undef, ptr %o12 %o13 = getelementptr inbounds <4 x double>, ptr undef, i32 4 + store volatile <4 x double> undef, ptr %o13 %p7 = getelementptr inbounds <4 x i8>, ptr undef, i32 31 + store volatile <4 x i8> undef, ptr %p7 %p8 = getelementptr inbounds <4 x i16>, ptr undef, i32 31 + store volatile <4 x i16> undef, ptr %p8 %p9 = getelementptr inbounds <4 x i32>, ptr undef, i32 31 + store volatile <4 x i32> undef, ptr %p9 %p10 = getelementptr inbounds <4 x i64>, ptr undef, i32 31 + store volatile <4 x i64> undef, ptr %p10 %p11 = getelementptr inbounds <4 x half>, ptr undef, i32 31 + store volatile <4 x half> undef, ptr %p11 %p12 = getelementptr inbounds <4 x float>, ptr undef, i32 31 + store volatile <4 x float> undef, ptr %p12 %p13 = getelementptr inbounds <4 x double>, ptr undef, i32 31 + store volatile <4 x double> undef, ptr %p13 %q7 = getelementptr inbounds <4 x i8>, ptr undef, i32 32 + store volatile <4 x i8> undef, ptr %q7 %q8 = getelementptr inbounds <4 x i16>, ptr undef, i32 32 + store volatile <4 x i16> undef, ptr %q8 %q9 = getelementptr inbounds <4 x i32>, ptr undef, i32 32 + store volatile <4 x i32> undef, ptr %q9 %q10 = getelementptr inbounds <4 x i64>, ptr undef, i32 32 + store volatile <4 x i64> undef, ptr %q10 %q11 = getelementptr inbounds <4 x half>, ptr undef, i32 32 + store volatile <4 x half> undef, ptr %q11 %q12 = getelementptr inbounds <4 x float>, ptr undef, i32 32 + store volatile <4 x float> undef, ptr %q12 %q13 = getelementptr inbounds <4 x double>, ptr undef, i32 32 + store volatile <4 x double> undef, ptr %q13 %r7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -31 + store volatile <4 x i8> undef, ptr %r7 %r8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -31 + store volatile <4 x i16> undef, ptr %r8 %r9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -31 + store volatile <4 x i32> undef, ptr %r9 %r10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -31 + store volatile <4 x i64> undef, ptr %r10 %r11 = getelementptr inbounds <4 x half>, ptr undef, i32 -31 + store volatile <4 x half> undef, ptr %r11 %r12 = getelementptr inbounds <4 x float>, ptr undef, i32 -31 + store volatile <4 x float> undef, ptr %r12 %r13 = getelementptr inbounds <4 x double>, ptr undef, i32 -31 + store volatile <4 x double> undef, ptr %r13 %s7 = getelementptr inbounds <4 x i8>, ptr undef, i32 -32 + store volatile <4 x i8> undef, ptr %s7 %s8 = getelementptr inbounds <4 x i16>, ptr undef, i32 -32 + store volatile <4 x i16> undef, ptr %s8 %s9 = getelementptr inbounds <4 x i32>, ptr undef, i32 -32 + store volatile <4 x i32> undef, ptr %s9 %s10 = getelementptr inbounds <4 x i64>, ptr undef, i32 -32 + store volatile <4 x i64> undef, ptr %s10 %s11 = getelementptr inbounds <4 x half>, ptr undef, i32 -32 + store volatile <4 x half> undef, ptr %s11 %s12 = getelementptr inbounds <4 x float>, ptr undef, i32 -32 + store volatile <4 x float> undef, ptr %s12 %s13 = getelementptr inbounds <4 x double>, ptr undef, i32 -32 + store volatile <4 x double> undef, ptr %s13 %c7 = getelementptr inbounds <4 x i8>, ptr undef, i32 %i + store volatile <4 x i8> undef, ptr %c7 %c8 = getelementptr inbounds <4 x i16>, ptr undef, i32 %i + store volatile <4 x i16> undef, ptr %c8 %c9 = getelementptr inbounds <4 x i32>, ptr undef, i32 %i + store volatile <4 x i32> undef, ptr %c9 %c10 = getelementptr inbounds <4 x i64>, ptr undef, i32 %i + store volatile <4 x i64> undef, ptr %c10 %c11 = getelementptr inbounds <4 x half>, ptr undef, i32 %i + store volatile <4 x half> undef, ptr %c11 %c12 = getelementptr inbounds <4 x float>, ptr undef, i32 %i + store volatile <4 x float> undef, ptr %c12 %c13 = getelementptr inbounds <4 x double>, ptr undef, i32 %i + store volatile <4 x double> undef, ptr %c13 %d0 = getelementptr inbounds i8, ptr undef, i32 -1 + store volatile i8 undef, ptr %d0 ret void } diff --git a/llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll b/llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll --- a/llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll +++ b/llvm/test/Analysis/CostModel/ARM/mve-gather-scatter-cost.ll @@ -136,25 +136,25 @@ define void @gep_v4i32(ptr %base, ptr %base16, ptr %base8, <4 x i32> %ind32, <4 x i16> %ind16, <4 x i1> %mask) { ; CHECK-LABEL: 'gep_v4i32' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep1 = getelementptr i32, ptr %base, <4 x i32> %ind32 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep1 = getelementptr i32, ptr %base, <4 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res1 = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %gep1, i32 4, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %res1, <4 x ptr> %gep1, i32 4, <4 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %indzext = zext <4 x i16> %ind16 to <4 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep2 = getelementptr i32, ptr %base, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep2 = getelementptr i32, ptr %base, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res2 = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %gep2, i32 4, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %res2, <4 x ptr> %gep2, i32 4, <4 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %indsext = sext <4 x i16> %ind16 to <4 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep3 = getelementptr i32, ptr %base, <4 x i32> %indsext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep3 = getelementptr i32, ptr %base, <4 x i32> %indsext ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res3 = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %gep3, i32 4, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %res3, <4 x ptr> %gep3, i32 4, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepu = getelementptr i32, ptr %base, <4 x i32> %ind32 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepu = getelementptr i32, ptr %base, <4 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %resu = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %gepu, i32 1, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %resu, <4 x ptr> %gepu, i32 1, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepos = getelementptr i8, ptr %base8, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepos = getelementptr i8, ptr %base8, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %geposb = bitcast <4 x ptr> %gepos to <4 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %resos = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %geposb, i32 4, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %resos, <4 x ptr> %geposb, i32 4, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i16, ptr %base16, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i16, ptr %base16, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbsb = bitcast <4 x ptr> %gepbs to <4 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %resbs = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %gepbsb, i32 4, <4 x i1> %mask, <4 x i32> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> %resbs, <4 x ptr> %gepbsb, i32 4, <4 x i1> %mask) @@ -209,11 +209,11 @@ ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepu = getelementptr float, ptr %base, <4 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %resu = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> %gepu, i32 1, <4 x i1> %mask, <4 x float> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> %resu, <4 x ptr> %gepu, i32 1, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepos = getelementptr i8, ptr %base8, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepos = getelementptr i8, ptr %base8, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %geposb = bitcast <4 x ptr> %gepos to <4 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %resos = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> %geposb, i32 4, <4 x i1> %mask, <4 x float> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> %resos, <4 x ptr> %geposb, i32 4, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i16, ptr %base16, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i16, ptr %base16, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbsb = bitcast <4 x ptr> %gepbs to <4 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %resbs = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> %gepbsb, i32 4, <4 x i1> %mask, <4 x float> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> %resbs, <4 x ptr> %gepbsb, i32 4, <4 x i1> %mask) @@ -254,18 +254,18 @@ define void @gep_v4i16(ptr %base, <4 x i32> %ind32, <4 x i16> %ind16, <4 x i1> %mask) { ; CHECK-LABEL: 'gep_v4i16' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep1 = getelementptr i16, ptr %base, <4 x i32> %ind32 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep1 = getelementptr i16, ptr %base, <4 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %res1 = call <4 x i16> @llvm.masked.gather.v4i16.v4p0(<4 x ptr> %gep1, i32 2, <4 x i1> %mask, <4 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: call void @llvm.masked.scatter.v4i16.v4p0(<4 x i16> %res1, <4 x ptr> %gep1, i32 2, <4 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %indzext = zext <4 x i16> %ind16 to <4 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep2 = getelementptr i16, ptr %base, <4 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep2 = getelementptr i16, ptr %base, <4 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %res2 = call <4 x i16> @llvm.masked.gather.v4i16.v4p0(<4 x ptr> %gep2, i32 2, <4 x i1> %mask, <4 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: call void @llvm.masked.scatter.v4i16.v4p0(<4 x i16> %res2, <4 x ptr> %gep2, i32 2, <4 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %indsext = sext <4 x i16> %ind16 to <4 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep3 = getelementptr i16, ptr %base, <4 x i32> %indsext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep3 = getelementptr i16, ptr %base, <4 x i32> %indsext ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %res3 = call <4 x i16> @llvm.masked.gather.v4i16.v4p0(<4 x ptr> %gep3, i32 2, <4 x i1> %mask, <4 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 56 for instruction: call void @llvm.masked.scatter.v4i16.v4p0(<4 x i16> %res3, <4 x ptr> %gep3, i32 2, <4 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep5 = getelementptr i16, ptr %base, <4 x i16> %ind16 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep5 = getelementptr i16, ptr %base, <4 x i16> %ind16 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res5 = call <4 x i16> @llvm.masked.gather.v4i16.v4p0(<4 x ptr> %gep5, i32 2, <4 x i1> %mask, <4 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res5zext = zext <4 x i16> %res5 to <4 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %res5trunc = trunc <4 x i32> %res5zext to <4 x i16> @@ -308,7 +308,7 @@ define void @gep_v4i8(ptr %base, <4 x i8> %ind8, <4 x i1> %mask) { ; CHECK-LABEL: 'gep_v4i8' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep5 = getelementptr i8, ptr %base, <4 x i8> %ind8 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep5 = getelementptr i8, ptr %base, <4 x i8> %ind8 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res5 = call <4 x i8> @llvm.masked.gather.v4i8.v4p0(<4 x ptr> %gep5, i32 2, <4 x i1> %mask, <4 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res5zext = zext <4 x i8> %res5 to <4 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %res5trunc = trunc <4 x i32> %res5zext to <4 x i8> @@ -337,29 +337,29 @@ define void @gep_v8i16(ptr %base, ptr %base8, ptr %base32, <8 x i32> %ind32, <8 x i16> %ind16, <8 x i8> %ind8, <8 x i1> %mask) { ; CHECK-LABEL: 'gep_v8i16' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep1 = getelementptr i16, ptr %base, <8 x i32> %ind32 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep1 = getelementptr i16, ptr %base, <8 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %res1 = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gep1, i32 2, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %res1, <8 x ptr> %gep1, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %indzext = zext <8 x i16> %ind16 to <8 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep2 = getelementptr i16, ptr %base, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep2 = getelementptr i16, ptr %base, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res2 = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gep2, i32 2, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %res2, <8 x ptr> %gep2, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %indsext = sext <8 x i16> %ind16 to <8 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep3 = getelementptr i16, ptr %base, <8 x i32> %indsext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep3 = getelementptr i16, ptr %base, <8 x i32> %indsext ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %res3 = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gep3, i32 2, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %res3, <8 x ptr> %gep3, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %resu = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gep2, i32 1, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %resu, <8 x ptr> %gep2, i32 1, <8 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepos = getelementptr i8, ptr %base8, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepos = getelementptr i8, ptr %base8, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %geposb = bitcast <8 x ptr> %gepos to <8 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %resos = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %geposb, i32 2, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %resos, <8 x ptr> %geposb, i32 2, <8 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i32, ptr %base32, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i32, ptr %base32, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbsb = bitcast <8 x ptr> %gepbs to <8 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %resbs = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gepbsb, i32 2, <8 x i1> %mask, <8 x i16> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 112 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %resbs, <8 x ptr> %gepbsb, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %indzext4 = zext <8 x i16> %ind16 to <8 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep4 = getelementptr i16, ptr %base, <8 x i32> %indzext4 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep4 = getelementptr i16, ptr %base, <8 x i32> %indzext4 ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %indtrunc = trunc <8 x i32> %ind32 to <8 x i16> ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: call void @llvm.masked.scatter.v8i16.v8p0(<8 x i16> %indtrunc, <8 x ptr> %gep4, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res = call <8 x i16> @llvm.masked.gather.v8i16.v8p0(<8 x ptr> %gep4, i32 2, <8 x i1> %mask, <8 x i16> undef) @@ -431,11 +431,11 @@ ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: call void @llvm.masked.scatter.v8f16.v8p0(<8 x half> %res3, <8 x ptr> %gep3, i32 2, <8 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %resu = call <8 x half> @llvm.masked.gather.v8f16.v8p0(<8 x ptr> %gep2, i32 1, <8 x i1> %mask, <8 x half> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: call void @llvm.masked.scatter.v8f16.v8p0(<8 x half> %resu, <8 x ptr> %gep2, i32 1, <8 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepos = getelementptr i8, ptr %base8, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepos = getelementptr i8, ptr %base8, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %geposb = bitcast <8 x ptr> %gepos to <8 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %resos = call <8 x half> @llvm.masked.gather.v8f16.v8p0(<8 x ptr> %geposb, i32 2, <8 x i1> %mask, <8 x half> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: call void @llvm.masked.scatter.v8f16.v8p0(<8 x half> %resos, <8 x ptr> %geposb, i32 2, <8 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i32, ptr %base32, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i32, ptr %base32, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbsb = bitcast <8 x ptr> %gepbs to <8 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %resbs = call <8 x half> @llvm.masked.gather.v8f16.v8p0(<8 x ptr> %gepbsb, i32 2, <8 x i1> %mask, <8 x half> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: call void @llvm.masked.scatter.v8f16.v8p0(<8 x half> %resbs, <8 x ptr> %gepbsb, i32 2, <8 x i1> %mask) @@ -480,7 +480,7 @@ define void @gep_v8i8(ptr %base, <8 x i8> %ind8, <8 x i1> %mask) { ; CHECK-LABEL: 'gep_v8i8' ; CHECK-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %indzext = zext <8 x i8> %ind8 to <8 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep5 = getelementptr i8, ptr %base, <8 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep5 = getelementptr i8, ptr %base, <8 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res5 = call <8 x i8> @llvm.masked.gather.v8i8.v8p0(<8 x ptr> %gep5, i32 2, <8 x i1> %mask, <8 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res5zext = zext <8 x i8> %res5 to <8 x i16> ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %res5trunc = trunc <8 x i16> %res5zext to <8 x i8> @@ -510,23 +510,23 @@ define void @gep_v16i8(ptr %base, ptr %base16, <16 x i8> %ind8, <16 x i32> %ind32, <16 x i1> %mask) { ; CHECK-LABEL: 'gep_v16i8' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep1 = getelementptr i8, ptr %base, <16 x i32> %ind32 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep1 = getelementptr i8, ptr %base, <16 x i32> %ind32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %res1 = call <16 x i8> @llvm.masked.gather.v16i8.v16p0(<16 x ptr> %gep1, i32 1, <16 x i1> %mask, <16 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %res1, <16 x ptr> %gep1, i32 2, <16 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %indzext = zext <16 x i8> %ind8 to <16 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep2 = getelementptr i8, ptr %base, <16 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep2 = getelementptr i8, ptr %base, <16 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res2 = call <16 x i8> @llvm.masked.gather.v16i8.v16p0(<16 x ptr> %gep2, i32 2, <16 x i1> %mask, <16 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %res2, <16 x ptr> %gep2, i32 2, <16 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %indsext = sext <16 x i8> %ind8 to <16 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep3 = getelementptr i8, ptr %base, <16 x i32> %indsext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep3 = getelementptr i8, ptr %base, <16 x i32> %indsext ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %res3 = call <16 x i8> @llvm.masked.gather.v16i8.v16p0(<16 x ptr> %gep3, i32 2, <16 x i1> %mask, <16 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %res3, <16 x ptr> %gep3, i32 2, <16 x i1> %mask) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i16, ptr %base16, <16 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i16, ptr %base16, <16 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbsb = bitcast <16 x ptr> %gepbs to <16 x ptr> ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %resbs = call <16 x i8> @llvm.masked.gather.v16i8.v16p0(<16 x ptr> %gepbsb, i32 2, <16 x i1> %mask, <16 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %resbs, <16 x ptr> %gepbsb, i32 2, <16 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 74 for instruction: %indzext4 = zext <16 x i8> %ind8 to <16 x i32> -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gep4 = getelementptr i8, ptr %base, <16 x i32> %indzext +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gep4 = getelementptr i8, ptr %base, <16 x i32> %indzext ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %indtrunc = trunc <16 x i32> %ind32 to <16 x i8> ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %indtrunc, <16 x ptr> %gep4, i32 2, <16 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void @@ -565,7 +565,7 @@ define void @gep_v16i8p(<16 x ptr> %base, i32 %off, <16 x i1> %mask) { ; CHECK-LABEL: 'gep_v16i8p' -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %gepbs = getelementptr i8, <16 x ptr> %base, i32 %off +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %gepbs = getelementptr i8, <16 x ptr> %base, i32 %off ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: %resbs = call <16 x i8> @llvm.masked.gather.v16i8.v16p0(<16 x ptr> %gepbs, i32 2, <16 x i1> %mask, <16 x i8> undef) ; CHECK-NEXT: Cost Model: Found an estimated cost of 224 for instruction: call void @llvm.masked.scatter.v16i8.v16p0(<16 x i8> %resbs, <16 x ptr> %gepbs, i32 2, <16 x i1> %mask) ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void diff --git a/llvm/test/Analysis/CostModel/RISCV/gep.ll b/llvm/test/Analysis/CostModel/RISCV/gep.ll --- a/llvm/test/Analysis/CostModel/RISCV/gep.ll +++ b/llvm/test/Analysis/CostModel/RISCV/gep.ll @@ -1,165 +1,422 @@ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py -; RUN: opt -mtriple=riscv32 -passes="print" 2>&1 -disable-output < %s \ -; RUN: | FileCheck %s -check-prefix=RVI -; RUN: opt -mtriple=riscv64 -passes="print" 2>&1 -disable-output < %s \ -; RUN: | FileCheck %s -check-prefix=RVI +; RUN: opt -mtriple=riscv32 -mattr=+v -passes="print" 2>&1 \ +; RUN: -disable-output < %s | FileCheck %s -check-prefix=RVI +; RUN: opt -mtriple=riscv64 -mattr=+v -passes="print" 2>&1 \ +; RUN: -disable-output < %s | FileCheck %s -check-prefix=RVI define void @testi8(ptr %a, i32 %i) { ; RVI-LABEL: 'testi8' ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i8, ptr %a, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a1, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i8, ptr %a, i32 -1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a2, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i8, ptr %a, i32 2047 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a3, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i8, ptr %a, i32 2048 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a4, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i8, ptr %a, i32 -2048 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a5, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i8, ptr %a, i32 -2049 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %a6, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i8, ptr %a, i32 %i +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %ai, align 1 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %a1 = getelementptr inbounds i8, ptr %a, i32 1 + store volatile i8 undef, ptr %a1 %a2 = getelementptr inbounds i8, ptr %a, i32 -1 + store volatile i8 undef, ptr %a2 %a3 = getelementptr inbounds i8, ptr %a, i32 2047 + store volatile i8 undef, ptr %a3 %a4 = getelementptr inbounds i8, ptr %a, i32 2048 + store volatile i8 undef, ptr %a4 %a5 = getelementptr inbounds i8, ptr %a, i32 -2048 + store volatile i8 undef, ptr %a5 %a6 = getelementptr inbounds i8, ptr %a, i32 -2049 + store volatile i8 undef, ptr %a6 %ai = getelementptr inbounds i8, ptr %a, i32 %i + store volatile i8 undef, ptr %ai ret void } define void @testi16(ptr %a, i32 %i) { ; RVI-LABEL: 'testi16' ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i16, ptr %a, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a1, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i16, ptr %a, i32 -1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a2, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i16, ptr %a, i32 1023 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a3, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i16, ptr %a, i32 1024 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a4, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i16, ptr %a, i32 -1024 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a5, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i16, ptr %a, i32 -1025 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %a6, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i16, ptr %a, i32 %i +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i16 undef, ptr %ai, align 2 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %a1 = getelementptr inbounds i16, ptr %a, i32 1 + store volatile i16 undef, ptr %a1 %a2 = getelementptr inbounds i16, ptr %a, i32 -1 + store volatile i16 undef, ptr %a2 %a3 = getelementptr inbounds i16, ptr %a, i32 1023 + store volatile i16 undef, ptr %a3 %a4 = getelementptr inbounds i16, ptr %a, i32 1024 + store volatile i16 undef, ptr %a4 %a5 = getelementptr inbounds i16, ptr %a, i32 -1024 + store volatile i16 undef, ptr %a5 %a6 = getelementptr inbounds i16, ptr %a, i32 -1025 + store volatile i16 undef, ptr %a6 %ai = getelementptr inbounds i16, ptr %a, i32 %i + store volatile i16 undef, ptr %ai ret void } define void @testi32(ptr %a, i32 %i) { ; RVI-LABEL: 'testi32' ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i32, ptr %a, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a1, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i32, ptr %a, i32 -1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a2, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i32, ptr %a, i32 511 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a3, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i32, ptr %a, i32 512 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a4, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i32, ptr %a, i32 -512 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a5, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i32, ptr %a, i32 -513 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %a6, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i32, ptr %a, i32 %i +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i32 undef, ptr %ai, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %a1 = getelementptr inbounds i32, ptr %a, i32 1 + store volatile i32 undef, ptr %a1 %a2 = getelementptr inbounds i32, ptr %a, i32 -1 + store volatile i32 undef, ptr %a2 %a3 = getelementptr inbounds i32, ptr %a, i32 511 + store volatile i32 undef, ptr %a3 %a4 = getelementptr inbounds i32, ptr %a, i32 512 + store volatile i32 undef, ptr %a4 %a5 = getelementptr inbounds i32, ptr %a, i32 -512 + store volatile i32 undef, ptr %a5 %a6 = getelementptr inbounds i32, ptr %a, i32 -513 + store volatile i32 undef, ptr %a6 %ai = getelementptr inbounds i32, ptr %a, i32 %i + store volatile i32 undef, ptr %ai ret void } define void @testi64(ptr %a, i32 %i) { -; RVI-LABEL: 'testi64' -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds i64, ptr %a, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds i64, ptr %a, i32 -1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds i64, ptr %a, i32 255 -; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds i64, ptr %a, i32 256 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds i64, ptr %a, i32 -256 -; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds i64, ptr %a, i32 -257 -; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds i64, ptr %a, i32 %i -; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void -; %a1 = getelementptr inbounds i64, ptr %a, i32 1 + store volatile i64 undef, ptr %a1 %a2 = getelementptr inbounds i64, ptr %a, i32 -1 + store volatile i64 undef, ptr %a2 %a3 = getelementptr inbounds i64, ptr %a, i32 255 + store volatile i64 undef, ptr %a3 %a4 = getelementptr inbounds i64, ptr %a, i32 256 + store volatile i64 undef, ptr %a4 %a5 = getelementptr inbounds i64, ptr %a, i32 -256 + store volatile i64 undef, ptr %a5 %a6 = getelementptr inbounds i64, ptr %a, i32 -257 + store volatile i64 undef, ptr %a6 %ai = getelementptr inbounds i64, ptr %a, i32 %i + store volatile i64 undef, ptr %ai ret void } define void @testfloat(ptr %a, i32 %i) { ; RVI-LABEL: 'testfloat' ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds float, ptr %a, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a1, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds float, ptr %a, i32 -1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a2, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds float, ptr %a, i32 511 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a3, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds float, ptr %a, i32 512 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a4, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds float, ptr %a, i32 -512 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a5, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds float, ptr %a, i32 -513 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %a6, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds float, ptr %a, i32 %i +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile float undef, ptr %ai, align 4 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %a1 = getelementptr inbounds float, ptr %a, i32 1 + store volatile float undef, ptr %a1 %a2 = getelementptr inbounds float, ptr %a, i32 -1 + store volatile float undef, ptr %a2 %a3 = getelementptr inbounds float, ptr %a, i32 511 + store volatile float undef, ptr %a3 %a4 = getelementptr inbounds float, ptr %a, i32 512 + store volatile float undef, ptr %a4 %a5 = getelementptr inbounds float, ptr %a, i32 -512 + store volatile float undef, ptr %a5 %a6 = getelementptr inbounds float, ptr %a, i32 -513 + store volatile float undef, ptr %a6 %ai = getelementptr inbounds float, ptr %a, i32 %i + store volatile float undef, ptr %ai ret void } define void @testdouble(ptr %a, i32 %i) { ; RVI-LABEL: 'testdouble' ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = getelementptr inbounds double, ptr %a, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a1, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = getelementptr inbounds double, ptr %a, i32 -1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a2, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = getelementptr inbounds double, ptr %a, i32 255 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a3, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a4 = getelementptr inbounds double, ptr %a, i32 256 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a4, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = getelementptr inbounds double, ptr %a, i32 -256 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a5, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a6 = getelementptr inbounds double, ptr %a, i32 -257 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %a6, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ai = getelementptr inbounds double, ptr %a, i32 %i +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile double undef, ptr %ai, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %a1 = getelementptr inbounds double, ptr %a, i32 1 + store volatile double undef, ptr %a1 %a2 = getelementptr inbounds double, ptr %a, i32 -1 + store volatile double undef, ptr %a2 %a3 = getelementptr inbounds double, ptr %a, i32 255 + store volatile double undef, ptr %a3 %a4 = getelementptr inbounds double, ptr %a, i32 256 + store volatile double undef, ptr %a4 %a5 = getelementptr inbounds double, ptr %a, i32 -256 + store volatile double undef, ptr %a5 %a6 = getelementptr inbounds double, ptr %a, i32 -257 + store volatile double undef, ptr %a6 %ai = getelementptr inbounds double, ptr %a, i32 %i + store volatile double undef, ptr %ai ret void } define void @testvecs(i32 %i) { ; RVI-LABEL: 'testvecs' -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b0 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b1 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b2 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b3 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b4 = getelementptr inbounds <4 x float>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %b5 = getelementptr inbounds <4 x double>, ptr undef, i32 1 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %c1 = getelementptr inbounds <4 x i8>, ptr undef, i32 128 -; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %c2 = getelementptr inbounds <4 x i16>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b0 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i8> undef, ptr %b0, align 4 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b1 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %b1, align 8 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b2 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %b2, align 16 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b3 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %b3, align 32 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b4 = getelementptr inbounds <4 x float>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %b4, align 16 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b5 = getelementptr inbounds <4 x double>, ptr undef, i32 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x double> undef, ptr %b5, align 32 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c1 = getelementptr inbounds <4 x i8>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i8> undef, ptr %c1, align 4 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c2 = getelementptr inbounds <4 x i16>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i16> undef, ptr %c2, align 8 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c3 = getelementptr inbounds <4 x i32>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x i32> undef, ptr %c3, align 16 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c4 = getelementptr inbounds <4 x i64>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x i64> undef, ptr %c4, align 32 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c5 = getelementptr inbounds <4 x float>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <4 x float> undef, ptr %c5, align 16 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c6 = getelementptr inbounds <4 x double>, ptr undef, i32 128 +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: store volatile <4 x double> undef, ptr %c6, align 32 ; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; %b0 = getelementptr inbounds <4 x i8>, ptr undef, i32 1 + store volatile <4 x i8> undef, ptr %b0 %b1 = getelementptr inbounds <4 x i16>, ptr undef, i32 1 + store volatile <4 x i16> undef, ptr %b1 %b2 = getelementptr inbounds <4 x i32>, ptr undef, i32 1 + store volatile <4 x i32> undef, ptr %b2 %b3 = getelementptr inbounds <4 x i64>, ptr undef, i32 1 + store volatile <4 x i64> undef, ptr %b3 %b4 = getelementptr inbounds <4 x float>, ptr undef, i32 1 + store volatile <4 x float> undef, ptr %b4 %b5 = getelementptr inbounds <4 x double>, ptr undef, i32 1 + store volatile <4 x double> undef, ptr %b5 %c1 = getelementptr inbounds <4 x i8>, ptr undef, i32 128 + store volatile <4 x i8> undef, ptr %c1 %c2 = getelementptr inbounds <4 x i16>, ptr undef, i32 128 + store volatile <4 x i16> undef, ptr %c2 %c3 = getelementptr inbounds <4 x i32>, ptr undef, i32 128 + store volatile <4 x i32> undef, ptr %c3 %c4 = getelementptr inbounds <4 x i64>, ptr undef, i32 128 + store volatile <4 x i64> undef, ptr %c4 %c5 = getelementptr inbounds <4 x float>, ptr undef, i32 128 + store volatile <4 x float> undef, ptr %c5 %c6 = getelementptr inbounds <4 x double>, ptr undef, i32 128 + store volatile <4 x double> undef, ptr %c6 ret void } + +; Ensure that memory operations of a different type than the pointer source type +; use the correct type to determine if folding is possible. These operations +; are on vector types so there should be a cost for the GEP as the offset cannot +; be folded into the instruction. +define void @non_foldable_vector_uses(ptr %base, <2 x ptr> %base.vec) { +; RVI-LABEL: 'non_foldable_vector_uses' +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x1 = load volatile <2 x i8>, ptr %1, align 2 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x2 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr %2, i32 1, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %x3 = call <2 x i8> @llvm.masked.gather.v2i8.v2p0(<2 x ptr> %3, i32 1, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x4 = call <2 x i8> @llvm.masked.expandload.v2i8(ptr %4, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x5 = call <2 x i8> @llvm.vp.load.v2i8.p0(ptr %5, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x6 = call <2 x i8> @llvm.experimental.vp.strided.load.v2i8.p0.i64(ptr %6, i64 undef, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <2 x i8> undef, ptr %7, align 2 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void @llvm.masked.store.v2i8.p0(<2 x i8> undef, ptr %8, i32 1, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: call void @llvm.masked.scatter.v2i8.v2p0(<2 x i8> undef, <2 x ptr> %9, i32 1, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.masked.compressstore.v2i8(<2 x i8> undef, ptr %10, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.vp.store.v2i8.p0(<2 x i8> undef, ptr %11, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.experimental.vp.strided.store.v2i8.p0.i64(<2 x i8> undef, ptr %12, i64 undef, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; + %1 = getelementptr i8, ptr %base, i32 42 + %x1 = load volatile <2 x i8>, ptr %1 + + %2 = getelementptr i8, ptr %base, i32 42 + %x2 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr %2, i32 1, <2 x i1> undef, <2 x i8> undef) + + %3 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> + %x3 = call <2 x i8> @llvm.masked.gather.v2i8.v2p0(<2 x ptr> %3, i32 1, <2 x i1> undef, <2 x i8> undef) + + %4 = getelementptr i8, ptr %base, i32 42 + %x4 = call <2 x i8> @llvm.masked.expandload.v2i8(ptr %4, <2 x i1> undef, <2 x i8> undef) + + %5 = getelementptr i8, ptr %base, i32 42 + %x5 = call <2 x i8> @llvm.vp.load.v2i8.p0(ptr %5, <2 x i1> undef, i32 undef) + + %6 = getelementptr i8, ptr %base, i32 42 + %x6 = call <2 x i8> @llvm.experimental.vp.strided.load.v2i8.i64(ptr %6, i64 undef, <2 x i1> undef, i32 undef) + + %7 = getelementptr i8, ptr %base, i32 42 + store volatile <2 x i8> undef, ptr %7 + + %8 = getelementptr i8, ptr %base, i32 42 + call void @llvm.masked.store.v2i8.p0(<2 x i8> undef, ptr %8, i32 1, <2 x i1> undef) + + %9 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> + call void @llvm.masked.scatter.v2i8.v2p0(<2 x i8> undef, <2 x ptr> %9, i32 1, <2 x i1> undef) + + %10 = getelementptr i8, ptr %base, i32 42 + call void @llvm.masked.compressstore.v2i8(<2 x i8> undef, ptr %10, <2 x i1> undef) + + %11 = getelementptr i8, ptr %base, i32 42 + call void @llvm.vp.store.v2i8.p0(<2 x i8> undef, ptr %11, <2 x i1> undef, i32 undef) + + %12 = getelementptr i8, ptr %base, i32 42 + call void @llvm.experimental.vp.strided.store.v2i8.i64(<2 x i8> undef, ptr %12, i64 undef, <2 x i1> undef, i32 undef) + + ret void +} + +; Because there is no offset the GEP should be compltely foldable into the user. +define void @foldable_vector_uses(ptr %base, <2 x ptr> %base.vec) { +; RVI-LABEL: 'foldable_vector_uses' +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %1 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x1 = load volatile <2 x i8>, ptr %1, align 2 +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %2 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x2 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr %2, i32 1, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %3 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> zeroinitializer +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %x3 = call <2 x i8> @llvm.masked.gather.v2i8.v2p0(<2 x ptr> %3, i32 1, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %4 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x4 = call <2 x i8> @llvm.masked.expandload.v2i8(ptr %4, <2 x i1> undef, <2 x i8> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %5 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x5 = call <2 x i8> @llvm.vp.load.v2i8.p0(ptr %5, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %6 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %x6 = call <2 x i8> @llvm.experimental.vp.strided.load.v2i8.p0.i64(ptr %6, i64 undef, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %7 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile <2 x i8> undef, ptr %7, align 2 +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %8 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void @llvm.masked.store.v2i8.p0(<2 x i8> undef, ptr %8, i32 1, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %9 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> zeroinitializer +; RVI-NEXT: Cost Model: Found an estimated cost of 2 for instruction: call void @llvm.masked.scatter.v2i8.v2p0(<2 x i8> undef, <2 x ptr> %9, i32 1, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %10 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.masked.compressstore.v2i8(<2 x i8> undef, ptr %10, <2 x i1> undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %11 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.vp.store.v2i8.p0(<2 x i8> undef, ptr %11, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %12 = getelementptr i8, ptr %base, i32 0 +; RVI-NEXT: Cost Model: Found an estimated cost of 12 for instruction: call void @llvm.experimental.vp.strided.store.v2i8.p0.i64(<2 x i8> undef, ptr %12, i64 undef, <2 x i1> undef, i32 undef) +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void +; + %1 = getelementptr i8, ptr %base, i32 0 + %x1 = load volatile <2 x i8>, ptr %1 + + %2 = getelementptr i8, ptr %base, i32 0 + %x2 = call <2 x i8> @llvm.masked.load.v2i8.p0(ptr %2, i32 1, <2 x i1> undef, <2 x i8> undef) + + %3 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> + %x3 = call <2 x i8> @llvm.masked.gather.v2i8.v2p0(<2 x ptr> %3, i32 1, <2 x i1> undef, <2 x i8> undef) + + %4 = getelementptr i8, ptr %base, i32 0 + %x4 = call <2 x i8> @llvm.masked.expandload.v2i8(ptr %4, <2 x i1> undef, <2 x i8> undef) + + %5 = getelementptr i8, ptr %base, i32 0 + %x5 = call <2 x i8> @llvm.vp.load.v2i8.p0(ptr %5, <2 x i1> undef, i32 undef) + + %6 = getelementptr i8, ptr %base, i32 0 + %x6 = call <2 x i8> @llvm.experimental.vp.strided.load.v2i8.i64(ptr %6, i64 undef, <2 x i1> undef, i32 undef) + + %7 = getelementptr i8, ptr %base, i32 0 + store volatile <2 x i8> undef, ptr %7 + + %8 = getelementptr i8, ptr %base, i32 0 + call void @llvm.masked.store.v2i8.p0(<2 x i8> undef, ptr %8, i32 1, <2 x i1> undef) + + %9 = getelementptr i8, <2 x ptr> %base.vec, <2 x i32> + call void @llvm.masked.scatter.v2i8.v2p0(<2 x i8> undef, <2 x ptr> %9, i32 1, <2 x i1> undef) + + %10 = getelementptr i8, ptr %base, i32 0 + call void @llvm.masked.compressstore.v2i8(<2 x i8> undef, ptr %10, <2 x i1> undef) + + %11 = getelementptr i8, ptr %base, i32 0 + call void @llvm.vp.store.v2i8.p0(<2 x i8> undef, ptr %11, <2 x i1> undef, i32 undef) + + %12 = getelementptr i8, ptr %base, i32 0 + call void @llvm.experimental.vp.strided.store.v2i8.i64(<2 x i8> undef, ptr %12, i64 undef, <2 x i1> undef, i32 undef) + + ret void +} + +declare <2 x i8> @llvm.masked.load.v2i8.p0(ptr, i32, <2 x i1>, <2 x i8>) +declare <2 x i8> @llvm.masked.gather.v2i8.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x i8>) +declare <2 x i8> @llvm.masked.expandload.v2i8(ptr, <2 x i1>, <2 x i8>) +declare <2 x i8> @llvm.vp.load.v2i8.p0(ptr, <2 x i1>, i32) +declare <2 x i8> @llvm.experimental.vp.strided.load.v2i8.i64(ptr, i64, <2 x i1>, i32) + +declare void @llvm.masked.store.v2i8.p0(<2 x i8>, ptr, i32, <2 x i1>) +declare void @llvm.masked.scatter.v2i8.v2p0(<2 x i8>, <2 x ptr>, i32, <2 x i1>) +declare void @llvm.masked.compressstore.v2i8(<2 x i8>, ptr, <2 x i1>) +declare void @llvm.vp.store.v2i8.p0(<2 x i8>, ptr, <2 x i1>, i32) +declare void @llvm.experimental.vp.strided.store.v2i8.i64(<2 x i8>, ptr, i64, <2 x i1>, i32) + +; Ensure that GEPs aren't folded if any of their uses aren't legal addressing +; modes +define <2 x i8> @fold_two_different_uses(ptr %base) { +; RVI-LABEL: 'fold_two_different_uses' +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = getelementptr i8, ptr %base, i32 42 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 2, ptr %1, align 1 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %x = load volatile <2 x i8>, ptr %1, align 2 +; RVI-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i8> %x +; + %1 = getelementptr i8, ptr %base, i32 42 + store volatile i8 2, ptr %1 + %x = load volatile <2 x i8>, ptr %1 + ret <2 x i8> %x +} diff --git a/llvm/test/Analysis/CostModel/X86/gep.ll b/llvm/test/Analysis/CostModel/X86/gep.ll --- a/llvm/test/Analysis/CostModel/X86/gep.ll +++ b/llvm/test/Analysis/CostModel/X86/gep.ll @@ -7,22 +7,30 @@ define void @test_geps() { ; THRU-LABEL: 'test_geps' ; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; LATE-LABEL: 'test_geps' ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; LATE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; SIZE-LABEL: 'test_geps' ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; ; SIZE_LATE-LABEL: 'test_geps' ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 +; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep0, align 1 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 +; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store volatile i8 undef, ptr %giant_gep1, align 1 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void ; @@ -37,9 +45,11 @@ ; dead code. ; This GEP has index INT64_MAX, which is cost 1. %giant_gep0 = getelementptr inbounds i8, ptr undef, i64 9223372036854775807 + store volatile i8 undef, ptr %giant_gep0 ; This GEP index wraps around to -1, which is cost 0. %giant_gep1 = getelementptr inbounds i8, ptr undef, i128 295147905179352825855 + store volatile i8 undef, ptr %giant_gep1 ret void } diff --git a/llvm/test/Transforms/Inline/AArch64/gep-cost.ll b/llvm/test/Transforms/Inline/AArch64/gep-cost.ll --- a/llvm/test/Transforms/Inline/AArch64/gep-cost.ll +++ b/llvm/test/Transforms/Inline/AArch64/gep-cost.ll @@ -23,9 +23,10 @@ ; Thus, both the gep and ret can be simplified. ; CHECK: Analyzing call of inner1 ; CHECK: NumInstructionsSimplified: 2 -; CHECK: NumInstructions: 2 +; CHECK: NumInstructions: 3 define void @inner1(ptr %ptr, i32 %i) { %G = getelementptr inbounds [4 x i32], ptr %ptr, i32 0, i32 %i + store i32 undef, ptr %G ret void } @@ -33,9 +34,10 @@ ; AArch64. Thus, only the ret can be simplified and not the gep. ; CHECK: Analyzing call of inner2 ; CHECK: NumInstructionsSimplified: 1 -; CHECK: NumInstructions: 2 +; CHECK: NumInstructions: 3 define void @inner2(ptr %ptr, i32 %i) { %G = getelementptr inbounds [4 x i32], ptr %ptr, i32 1, i32 %i + store i32 undef, ptr %G ret void } @@ -44,8 +46,9 @@ ; gep and ret can be simplified. ; CHECK: Analyzing call of inner3 ; CHECK: NumInstructionsSimplified: 2 -; CHECK: NumInstructions: 2 +; CHECK: NumInstructions: 3 define void @inner3(ptr %ptr, i32 %i, i32 %j) { %G = getelementptr inbounds [4 x i32], ptr %ptr, i32 %i, i32 %j + store i32 undef, ptr %G ret void } diff --git a/llvm/test/Transforms/Inline/alloca-bonus.ll b/llvm/test/Transforms/Inline/alloca-bonus.ll --- a/llvm/test/Transforms/Inline/alloca-bonus.ll +++ b/llvm/test/Transforms/Inline/alloca-bonus.ll @@ -38,6 +38,7 @@ %A = load i32, ptr %ptr store i32 0, ptr %ptr %D = getelementptr inbounds i32, ptr %ptr, i32 %A + store i32 undef, ptr %D %F = select i1 false, ptr %ptr, ptr @glbl call void @llvm.lifetime.start.p0(i64 0, ptr %ptr) call void @extern() diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll b/llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll --- a/llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll +++ b/llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll @@ -698,7 +698,7 @@ ; STRIDED-NEXT: entry: ; STRIDED-NEXT: [[TMP0:%.*]] = call i64 @llvm.vscale.i64() ; STRIDED-NEXT: [[TMP1:%.*]] = mul i64 [[TMP0]], 4 -; STRIDED-NEXT: [[TMP2:%.*]] = call i64 @llvm.umax.i64(i64 16, i64 [[TMP1]]) +; STRIDED-NEXT: [[TMP2:%.*]] = call i64 @llvm.umax.i64(i64 24, i64 [[TMP1]]) ; STRIDED-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 1024, [[TMP2]] ; STRIDED-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_MEMCHECK:%.*]] ; STRIDED: vector.memcheck: diff --git a/llvm/test/Transforms/LoopVectorize/X86/pointer-runtime-checks-unprofitable.ll b/llvm/test/Transforms/LoopVectorize/X86/pointer-runtime-checks-unprofitable.ll --- a/llvm/test/Transforms/LoopVectorize/X86/pointer-runtime-checks-unprofitable.ll +++ b/llvm/test/Transforms/LoopVectorize/X86/pointer-runtime-checks-unprofitable.ll @@ -12,15 +12,15 @@ define void @test(double* nocapture %A, double* nocapture %B, double* nocapture %C, double* nocapture %D, double* nocapture %E) { ; CHECK: Calculating cost of runtime checks: -; CHECK-NEXT: 0 for {{.+}} = getelementptr double, double* %A, i64 16 +; CHECK-NEXT: 1 for {{.+}} = getelementptr double, double* %A, i64 16 ; CHECK-NEXT: 0 for {{.+}} = bitcast double* -; CHECK-NEXT: 0 for {{.+}} = getelementptr double, double* %B, i64 16 +; CHECK-NEXT: 1 for {{.+}} = getelementptr double, double* %B, i64 16 ; CHECK-NEXT: 0 for {{.+}} = bitcast double* -; CHECK-NEXT: 0 for {{.+}} = getelementptr double, double* %E, i64 16 +; CHECK-NEXT: 1 for {{.+}} = getelementptr double, double* %E, i64 16 ; CHECK-NEXT: 0 for {{.+}} = bitcast double* -; CHECK-NEXT: 0 for {{.+}} = getelementptr double, double* %C, i64 16 +; CHECK-NEXT: 1 for {{.+}} = getelementptr double, double* %C, i64 16 ; CHECK-NEXT: 0 for {{.+}} = bitcast double* -; CHECK-NEXT: 0 for {{.+}} = getelementptr double, double* %D, i64 16 +; CHECK-NEXT: 1 for {{.+}} = getelementptr double, double* %D, i64 16 ; CHECK-NEXT: 0 for {{.+}} = bitcast double* ; CHECK-NEXT: 1 for {{.+}} = icmp ult i8* ; CHECK-NEXT: 1 for {{.+}} = icmp ult i8* @@ -57,9 +57,9 @@ ; CHECK-NEXT: 1 for {{.+}} = icmp ult i8* ; CHECK-NEXT: 1 for {{.+}} = and i1 ; CHECK-NEXT: 1 for {{.+}} = or i1 -; CHECK-NEXT: Total cost of runtime checks: 35 +; CHECK-NEXT: Total cost of runtime checks: 40 -; CHECK: LV: Vectorization is not beneficial: expected trip count < minimum profitable VF (16 < 24) +; CHECK: LV: Vectorization is not beneficial: expected trip count < minimum profitable VF (16 < 28) ; ; CHECK-LABEL: @test( ; CHECK-NEXT: entry: diff --git a/llvm/test/Transforms/LoopVectorize/X86/pr23997.ll b/llvm/test/Transforms/LoopVectorize/X86/pr23997.ll --- a/llvm/test/Transforms/LoopVectorize/X86/pr23997.ll +++ b/llvm/test/Transforms/LoopVectorize/X86/pr23997.ll @@ -13,7 +13,7 @@ ; CHECK-NEXT: [[DOT10:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0:%.*]], i64 16 ; CHECK-NEXT: [[DOT12:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP1:%.*]], i64 16 ; CHECK-NEXT: [[UMAX2:%.*]] = call i64 @llvm.umax.i64(i64 [[TMP2:%.*]], i64 1) -; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[UMAX2]], 16 +; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[UMAX2]], 20 ; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_MEMCHECK:%.*]] ; CHECK: vector.memcheck: ; CHECK-NEXT: [[UMAX:%.*]] = call i64 @llvm.umax.i64(i64 [[TMP2]], i64 1) @@ -32,23 +32,23 @@ ; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ] ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[DOT12]], i64 [[INDEX]] ; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP5]], align 8, !alias.scope !0 -; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 4 -; CHECK-NEXT: [[WIDE_LOAD3:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP7]], align 8, !alias.scope !0 -; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 8 -; CHECK-NEXT: [[WIDE_LOAD4:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP9]], align 8, !alias.scope !0 -; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 12 -; CHECK-NEXT: [[WIDE_LOAD5:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP11]], align 8, !alias.scope !0 -; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[DOT10]], i64 [[INDEX]] -; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD]], ptr addrspace(1) [[TMP13]], align 8, !alias.scope !3, !noalias !0 -; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP13]], i64 4 -; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD3]], ptr addrspace(1) [[TMP15]], align 8, !alias.scope !3, !noalias !0 -; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP13]], i64 8 -; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD4]], ptr addrspace(1) [[TMP17]], align 8, !alias.scope !3, !noalias !0 -; CHECK-NEXT: [[TMP19:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP13]], i64 12 -; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD5]], ptr addrspace(1) [[TMP19]], align 8, !alias.scope !3, !noalias !0 +; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 4 +; CHECK-NEXT: [[WIDE_LOAD3:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP6]], align 8, !alias.scope !0 +; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 8 +; CHECK-NEXT: [[WIDE_LOAD4:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP7]], align 8, !alias.scope !0 +; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP5]], i64 12 +; CHECK-NEXT: [[WIDE_LOAD5:%.*]] = load <4 x ptr addrspace(1)>, ptr addrspace(1) [[TMP8]], align 8, !alias.scope !0 +; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[DOT10]], i64 [[INDEX]] +; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD]], ptr addrspace(1) [[TMP9]], align 8, !alias.scope !3, !noalias !0 +; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP9]], i64 4 +; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD3]], ptr addrspace(1) [[TMP10]], align 8, !alias.scope !3, !noalias !0 +; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP9]], i64 8 +; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD4]], ptr addrspace(1) [[TMP11]], align 8, !alias.scope !3, !noalias !0 +; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds ptr addrspace(1), ptr addrspace(1) [[TMP9]], i64 12 +; CHECK-NEXT: store <4 x ptr addrspace(1)> [[WIDE_LOAD5]], ptr addrspace(1) [[TMP12]], align 8, !alias.scope !3, !noalias !0 ; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 16 -; CHECK-NEXT: [[TMP21:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]] -; CHECK-NEXT: br i1 [[TMP21]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP5:![0-9]+]] +; CHECK-NEXT: [[TMP13:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]] +; CHECK-NEXT: br i1 [[TMP13]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP5:![0-9]+]] ; CHECK: middle.block: ; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[UMAX2]], [[N_VEC]] ; CHECK-NEXT: br i1 [[CMP_N]], label [[LOOPEXIT:%.*]], label [[SCALAR_PH]] @@ -63,7 +63,7 @@ ; CHECK-NEXT: store ptr addrspace(1) [[V]], ptr addrspace(1) [[DOT20]], align 8 ; CHECK-NEXT: [[INDVARS_IV_NEXT4]] = add nuw nsw i64 [[INDVARS_IV3]], 1 ; CHECK-NEXT: [[DOT21:%.*]] = icmp ult i64 [[INDVARS_IV_NEXT4]], [[TMP2]] -; CHECK-NEXT: br i1 [[DOT21]], label [[LOOP]], label [[LOOPEXIT]], !llvm.loop [[LOOP7:![0-9]+]] +; CHECK-NEXT: br i1 [[DOT21]], label [[LOOP]], label [[LOOPEXIT]], !llvm.loop [[LOOP8:![0-9]+]] ; CHECK: loopexit: ; CHECK-NEXT: ret void ; diff --git a/llvm/test/Transforms/LoopVectorize/X86/pr54634.ll b/llvm/test/Transforms/LoopVectorize/X86/pr54634.ll --- a/llvm/test/Transforms/LoopVectorize/X86/pr54634.ll +++ b/llvm/test/Transforms/LoopVectorize/X86/pr54634.ll @@ -19,7 +19,7 @@ ; CHECK-NEXT: [[DOTELT1:%.*]] = getelementptr inbounds { ptr addrspace(10), i64 }, ptr addrspace(10) [[TMP5]], i64 0, i32 1 ; CHECK-NEXT: [[DOTUNPACK2:%.*]] = load i64, ptr addrspace(10) [[DOTELT1]], align 8, !tbaa [[TBAA8]] ; CHECK-NEXT: [[TMP8:%.*]] = add nsw i64 [[TMP2]], 1 -; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP8]], 28 +; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP8]], 36 ; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_SCEVCHECK:%.*]] ; CHECK: vector.scevcheck: ; CHECK-NEXT: [[MUL:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[TMP2]]) diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/gep.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/gep.ll --- a/llvm/test/Transforms/SLPVectorizer/RISCV/gep.ll +++ b/llvm/test/Transforms/SLPVectorizer/RISCV/gep.ll @@ -2,15 +2,20 @@ ; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v \ ; RUN: -riscv-v-slp-max-vf=0 -S | FileCheck %s -; FIXME: This should not be vectorized +; This should not be vectorized as the extra cost of the address computation +; that can't be folded into the vle8/vse8 outweighs the scalar cost. define void @copy_with_offset_v2i8(ptr noalias %p, ptr noalias %q) { ; CHECK-LABEL: @copy_with_offset_v2i8( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[P1:%.*]] = getelementptr i8, ptr [[P:%.*]], i32 8 +; CHECK-NEXT: [[X1:%.*]] = load i8, ptr [[P1]], align 1 ; CHECK-NEXT: [[Q1:%.*]] = getelementptr i8, ptr [[Q:%.*]], i32 16 -; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i8>, ptr [[P1]], align 1 -; CHECK-NEXT: store <2 x i8> [[TMP0]], ptr [[Q1]], align 1 +; CHECK-NEXT: store i8 [[X1]], ptr [[Q1]], align 1 +; CHECK-NEXT: [[P2:%.*]] = getelementptr i8, ptr [[P]], i32 9 +; CHECK-NEXT: [[X2:%.*]] = load i8, ptr [[P2]], align 1 +; CHECK-NEXT: [[Q2:%.*]] = getelementptr i8, ptr [[Q]], i32 17 +; CHECK-NEXT: store i8 [[X2]], ptr [[Q2]], align 1 ; CHECK-NEXT: ret void ; entry: diff --git a/llvm/test/Transforms/SLPVectorizer/X86/geps-non-pow-2.ll b/llvm/test/Transforms/SLPVectorizer/X86/geps-non-pow-2.ll --- a/llvm/test/Transforms/SLPVectorizer/X86/geps-non-pow-2.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/geps-non-pow-2.ll @@ -11,36 +11,37 @@ ; CHECK-NEXT: [[TOBOOL_NOT19:%.*]] = icmp eq i32 [[TMP0]], 0 ; CHECK-NEXT: br i1 [[TOBOOL_NOT19]], label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]] ; CHECK: while.body: -; CHECK-NEXT: [[C_022:%.*]] = phi ptr [ [[C_022_BE:%.*]], [[WHILE_BODY_BACKEDGE:%.*]] ], [ undef, [[ENTRY:%.*]] ] -; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x ptr> [ [[TMP14:%.*]], [[WHILE_BODY_BACKEDGE]] ], [ undef, [[ENTRY]] ] -; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr inbounds i32, ptr [[C_022]], i64 1 -; CHECK-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[C_022]] to i64 -; CHECK-NEXT: [[TMP3:%.*]] = trunc i64 [[TMP2]] to i32 -; CHECK-NEXT: [[TMP4:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> -; CHECK-NEXT: switch i32 [[TMP3]], label [[WHILE_BODY_BACKEDGE]] [ +; CHECK-NEXT: [[A_020:%.*]] = phi ptr [ [[A_020_BE:%.*]], [[WHILE_BODY_BACKEDGE:%.*]] ], [ undef, [[ENTRY:%.*]] ] +; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x ptr> [ [[TMP15:%.*]], [[WHILE_BODY_BACKEDGE]] ], [ undef, [[ENTRY]] ] +; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x ptr> [[TMP1]], i32 0 +; CHECK-NEXT: [[TMP3:%.*]] = ptrtoint ptr [[TMP2]] to i64 +; CHECK-NEXT: [[TMP4:%.*]] = trunc i64 [[TMP3]] to i32 +; CHECK-NEXT: [[INCDEC_PTR1:%.*]] = getelementptr inbounds i32, ptr [[A_020]], i64 1 +; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> +; CHECK-NEXT: switch i32 [[TMP4]], label [[WHILE_BODY_BACKEDGE]] [ ; CHECK-NEXT: i32 2, label [[SW_BB:%.*]] ; CHECK-NEXT: i32 4, label [[SW_BB6:%.*]] ; CHECK-NEXT: ] ; CHECK: sw.bb: -; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x ptr> [[TMP4]], i32 0 -; CHECK-NEXT: [[TMP6:%.*]] = ptrtoint ptr [[TMP5]] to i64 -; CHECK-NEXT: [[TMP7:%.*]] = trunc i64 [[TMP6]] to i32 -; CHECK-NEXT: [[TMP8:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> -; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x ptr> [[TMP4]], i32 1 -; CHECK-NEXT: store i32 [[TMP7]], ptr [[TMP9]], align 4 -; CHECK-NEXT: [[INCDEC_PTR5:%.*]] = getelementptr inbounds i32, ptr [[C_022]], i64 2 +; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x ptr> [[TMP5]], i32 1 +; CHECK-NEXT: [[TMP7:%.*]] = ptrtoint ptr [[TMP6]] to i64 +; CHECK-NEXT: [[TMP8:%.*]] = trunc i64 [[TMP7]] to i32 +; CHECK-NEXT: [[INCDEC_PTR4:%.*]] = getelementptr inbounds i32, ptr [[A_020]], i64 2 +; CHECK-NEXT: store i32 [[TMP8]], ptr [[INCDEC_PTR1]], align 4 +; CHECK-NEXT: [[TMP9:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> ; CHECK-NEXT: br label [[WHILE_BODY_BACKEDGE]] ; CHECK: sw.bb6: -; CHECK-NEXT: [[INCDEC_PTR8:%.*]] = getelementptr inbounds i32, ptr [[C_022]], i64 2 -; CHECK-NEXT: [[TMP10:%.*]] = ptrtoint ptr [[INCDEC_PTR]] to i64 -; CHECK-NEXT: [[TMP11:%.*]] = trunc i64 [[TMP10]] to i32 -; CHECK-NEXT: [[TMP12:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> -; CHECK-NEXT: [[TMP13:%.*]] = extractelement <2 x ptr> [[TMP4]], i32 0 -; CHECK-NEXT: store i32 [[TMP11]], ptr [[TMP13]], align 4 +; CHECK-NEXT: [[INCDEC_PTR7:%.*]] = getelementptr inbounds i32, ptr [[A_020]], i64 2 +; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x ptr> [[TMP5]], i32 0 +; CHECK-NEXT: [[TMP11:%.*]] = ptrtoint ptr [[TMP10]] to i64 +; CHECK-NEXT: [[TMP12:%.*]] = trunc i64 [[TMP11]] to i32 +; CHECK-NEXT: [[TMP13:%.*]] = getelementptr i32, <2 x ptr> [[TMP1]], <2 x i64> +; CHECK-NEXT: [[TMP14:%.*]] = extractelement <2 x ptr> [[TMP5]], i32 1 +; CHECK-NEXT: store i32 [[TMP12]], ptr [[TMP14]], align 4 ; CHECK-NEXT: br label [[WHILE_BODY_BACKEDGE]] ; CHECK: while.body.backedge: -; CHECK-NEXT: [[C_022_BE]] = phi ptr [ [[INCDEC_PTR]], [[WHILE_BODY]] ], [ [[INCDEC_PTR8]], [[SW_BB6]] ], [ [[INCDEC_PTR5]], [[SW_BB]] ] -; CHECK-NEXT: [[TMP14]] = phi <2 x ptr> [ [[TMP4]], [[WHILE_BODY]] ], [ [[TMP12]], [[SW_BB6]] ], [ [[TMP8]], [[SW_BB]] ] +; CHECK-NEXT: [[A_020_BE]] = phi ptr [ [[INCDEC_PTR1]], [[WHILE_BODY]] ], [ [[INCDEC_PTR7]], [[SW_BB6]] ], [ [[INCDEC_PTR4]], [[SW_BB]] ] +; CHECK-NEXT: [[TMP15]] = phi <2 x ptr> [ [[TMP5]], [[WHILE_BODY]] ], [ [[TMP13]], [[SW_BB6]] ], [ [[TMP9]], [[SW_BB]] ] ; CHECK-NEXT: br label [[WHILE_BODY]] ; CHECK: while.end: ; CHECK-NEXT: ret i32 undef