Index: llvm/include/llvm/Analysis/TargetTransformInfo.h =================================================================== --- llvm/include/llvm/Analysis/TargetTransformInfo.h +++ llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -221,28 +221,6 @@ TCK_SizeAndLatency ///< The weighted sum of size and latency. }; - /// Query the cost of a specified instruction. - /// - /// Clients should use this interface to query the cost of an existing - /// instruction. The instruction must have a valid parent (basic block). - /// - /// Note, this method does not cache the cost calculation and it - /// can be expensive in some cases. - int getInstructionCost(const Instruction *I, enum TargetCostKind kind) const { - switch (kind) { - case TCK_RecipThroughput: - return getInstructionThroughput(I); - - case TCK_Latency: - return getInstructionLatency(I); - - case TCK_CodeSize: - case TCK_SizeAndLatency: - return getUserCost(I, kind); - } - llvm_unreachable("Unknown instruction cost kind"); - } - /// Underlying constants for 'cost' values in this interface. /// /// Many APIs in this interface return a cost. This enum defines the @@ -317,15 +295,15 @@ /// /// The returned cost is defined in terms of \c TargetCostConstants, see its /// comments for a detailed explanation of the cost values. - int getUserCost(const User *U, ArrayRef Operands, + int getInstructionCost(const User *U, ArrayRef Operands, TargetCostKind CostKind) const; - /// This is a helper function which calls the two-argument getUserCost + /// This is a helper function which calls the two-argument getInstructionCost /// with \p Operands which are the current operands U has. - int getUserCost(const User *U, TargetCostKind CostKind) const { + int getInstructionCost(const User *U, TargetCostKind CostKind) const { SmallVector Operands(U->value_op_begin(), U->value_op_end()); - return getUserCost(U, Operands, CostKind); + return getInstructionCost(U, Operands, CostKind); } /// Return true if branch divergence exists. @@ -417,7 +395,7 @@ /// Parameters that control the generic loop unrolling transformation. struct UnrollingPreferences { /// The cost threshold for the unrolled loop. Should be relative to the - /// getUserCost values returned by this API, and the expectation is that + /// getInstructionCost values returned by this API, and the expectation is that /// the unrolled loop's instructions when run through that interface should /// not exceed this cost. However, this is only an estimate. Also, specific /// loops may be unrolled even with a cost above this threshold if deemed @@ -1235,14 +1213,6 @@ /// @} private: - /// Estimate the latency of specified instruction. - /// Returns 1 as the default value. - int getInstructionLatency(const Instruction *I) const; - - /// Returns the expected throughput cost of the instruction. - /// Returns -1 if the cost is unknown. - int getInstructionThroughput(const Instruction *I) const; - /// The abstract base class used to type erase specific TTI /// implementations. class Concept; @@ -1268,7 +1238,7 @@ getEstimatedNumberOfCaseClusters(const SwitchInst &SI, unsigned &JTSize, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI) = 0; - virtual int getUserCost(const User *U, ArrayRef Operands, + virtual int getInstructionCost(const User *U, ArrayRef Operands, TargetCostKind CostKind) = 0; virtual bool hasBranchDivergence() = 0; virtual bool useGPUDivergenceAnalysis() = 0; @@ -1497,7 +1467,6 @@ virtual bool shouldExpandReduction(const IntrinsicInst *II) const = 0; virtual unsigned getGISelRematGlobalCost() const = 0; virtual bool hasActiveVectorLength() const = 0; - virtual int getInstructionLatency(const Instruction *I) = 0; }; template @@ -1526,9 +1495,9 @@ int getMemcpyCost(const Instruction *I) override { return Impl.getMemcpyCost(I); } - int getUserCost(const User *U, ArrayRef Operands, + int getInstructionCost(const User *U, ArrayRef Operands, TargetCostKind CostKind) override { - return Impl.getUserCost(U, Operands, CostKind); + return Impl.getInstructionCost(U, Operands, CostKind); } bool hasBranchDivergence() override { return Impl.hasBranchDivergence(); } bool useGPUDivergenceAnalysis() override { @@ -1983,10 +1952,6 @@ bool hasActiveVectorLength() const override { return Impl.hasActiveVectorLength(); } - - int getInstructionLatency(const Instruction *I) override { - return Impl.getInstructionLatency(I); - } }; template Index: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h =================================================================== --- llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -799,8 +799,8 @@ return TTI::TCC_Basic; } - int getUserCost(const User *U, ArrayRef Operands, - TTI::TargetCostKind CostKind) { + int getInstructionCost(const User *U, ArrayRef Operands, + TTI::TargetCostKind CostKind) { auto *TargetTTI = static_cast(this); // FIXME: We shouldn't have to special-case intrinsics here. @@ -833,6 +833,7 @@ Type *OpTy = U->getNumOperands() == 1 ? U->getOperand(0)->getType() : nullptr; unsigned Opcode = Operator::getOpcode(U); + // U is likely to be an instruction, but it could be a constantexpr. auto *I = dyn_cast(U); switch (Opcode) { default: @@ -906,6 +907,9 @@ CostKind, I); } case Instruction::Load: { + // FIXME: Arbitary cost which could come from the backend. + if (CostKind == TTI::TCK_Latency) + return 4; auto *LI = cast(U); return TargetTTI->getMemoryOpCost(Opcode, U->getType(), LI->getAlign(), LI->getPointerAddressSpace(), @@ -1006,40 +1010,9 @@ Idx); } } - // By default, just classify everything as 'basic'. - return TTI::TCC_Basic; - } - - int getInstructionLatency(const Instruction *I) { - SmallVector Operands(I->value_op_begin(), - I->value_op_end()); - if (getUserCost(I, Operands, TTI::TCK_Latency) == TTI::TCC_Free) - return 0; - - if (isa(I)) - return 4; - - Type *DstTy = I->getType(); - - // Usually an intrinsic is a simple instruction. - // A real function call is much slower. - if (auto *CI = dyn_cast(I)) { - const Function *F = CI->getCalledFunction(); - if (!F || static_cast(this)->isLoweredToCall(F)) - return 40; - // Some intrinsics return a value and a flag, we use the value type - // to decide its latency. - if (StructType *StructTy = dyn_cast(DstTy)) - DstTy = StructTy->getElementType(0); - // Fall through to simple instructions. - } - - if (VectorType *VectorTy = dyn_cast(DstTy)) - DstTy = VectorTy->getElementType(); - if (DstTy->isFloatingPointTy()) - return 3; - - return 1; + // By default, just classify everything as 'basic' or -1 to represent that + // don't know the throughput cost. + return CostKind == TTI::TCK_RecipThroughput ? - 1: TTI::TCC_Basic; } }; } // namespace llvm Index: llvm/lib/Analysis/CodeMetrics.cpp =================================================================== --- llvm/lib/Analysis/CodeMetrics.cpp +++ llvm/lib/Analysis/CodeMetrics.cpp @@ -170,7 +170,7 @@ if (InvI->cannotDuplicate()) notDuplicatable = true; - NumInsts += TTI.getUserCost(&I, TargetTransformInfo::TCK_CodeSize); + NumInsts += TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize); } if (isa(BB->getTerminator())) Index: llvm/lib/Analysis/CostModel.cpp =================================================================== --- llvm/lib/Analysis/CostModel.cpp +++ llvm/lib/Analysis/CostModel.cpp @@ -50,14 +50,6 @@ *PassRegistry::getPassRegistry()); } - /// Returns the expected cost of the instruction. - /// Returns -1 if the cost is unknown. - /// Note, this method does not cache the cost calculation and it - /// can be expensive in some cases. - unsigned getInstructionCost(const Instruction *I) const { - return TTI->getInstructionCost(I, TargetTransformInfo::TCK_RecipThroughput); - } - private: void getAnalysisUsage(AnalysisUsage &AU) const override; bool runOnFunction(Function &F) override; Index: llvm/lib/Analysis/InlineCost.cpp =================================================================== --- llvm/lib/Analysis/InlineCost.cpp +++ llvm/lib/Analysis/InlineCost.cpp @@ -828,7 +828,7 @@ else Operands.push_back(*I); return TargetTransformInfo::TCC_Free == - TTI.getUserCost(&GEP, Operands, + TTI.getInstructionCost(&GEP, Operands, TargetTransformInfo::TCK_SizeAndLatency); } @@ -1078,7 +1078,7 @@ SROAArgValues[&I] = SROAArg; return TargetTransformInfo::TCC_Free == - TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency); + TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency); } bool CallAnalyzer::visitIntToPtr(IntToPtrInst &I) { @@ -1103,7 +1103,7 @@ SROAArgValues[&I] = SROAArg; return TargetTransformInfo::TCC_Free == - TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency); + TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency); } bool CallAnalyzer::visitCastInst(CastInst &I) { @@ -1135,7 +1135,7 @@ } return TargetTransformInfo::TCC_Free == - TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency); + TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency); } bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) { @@ -1838,7 +1838,7 @@ // Some instructions are free. All of the free intrinsics can also be // handled by SROA, etc. if (TargetTransformInfo::TCC_Free == - TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency)) + TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency)) return true; // We found something we don't understand or can't handle. Mark any SROA-able Index: llvm/lib/Analysis/TargetTransformInfo.cpp =================================================================== --- llvm/lib/Analysis/TargetTransformInfo.cpp +++ llvm/lib/Analysis/TargetTransformInfo.cpp @@ -257,10 +257,10 @@ return TTIImpl->getEstimatedNumberOfCaseClusters(SI, JTSize, PSI, BFI); } -int TargetTransformInfo::getUserCost(const User *U, +int TargetTransformInfo::getInstructionCost(const User *U, ArrayRef Operands, enum TargetCostKind CostKind) const { - int Cost = TTIImpl->getUserCost(U, Operands, CostKind); + int Cost = TTIImpl->getInstructionCost(U, Operands, CostKind); assert((CostKind == TTI::TCK_RecipThroughput || Cost >= 0) && "TTI should not produce negative costs!"); return Cost; @@ -950,10 +950,6 @@ return TTIImpl->getGISelRematGlobalCost(); } -int TargetTransformInfo::getInstructionLatency(const Instruction *I) const { - return TTIImpl->getInstructionLatency(I); -} - static bool matchPairwiseShuffleMask(ShuffleVectorInst *SI, bool IsLeft, unsigned Level) { // We don't need a shuffle if we just want to have element 0 in position 0 of @@ -1224,63 +1220,6 @@ return RD->Kind; } -int TargetTransformInfo::getInstructionThroughput(const Instruction *I) const { - TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput; - - switch (I->getOpcode()) { - case Instruction::GetElementPtr: - case Instruction::Ret: - case Instruction::PHI: - case Instruction::Br: - case Instruction::Add: - case Instruction::FAdd: - case Instruction::Sub: - case Instruction::FSub: - case Instruction::Mul: - case Instruction::FMul: - case Instruction::UDiv: - case Instruction::SDiv: - case Instruction::FDiv: - case Instruction::URem: - case Instruction::SRem: - case Instruction::FRem: - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: - case Instruction::And: - case Instruction::Or: - case Instruction::Xor: - case Instruction::FNeg: - case Instruction::Select: - case Instruction::ICmp: - case Instruction::FCmp: - case Instruction::Store: - case Instruction::Load: - case Instruction::ZExt: - case Instruction::SExt: - case Instruction::FPToUI: - case Instruction::FPToSI: - case Instruction::FPExt: - case Instruction::PtrToInt: - case Instruction::IntToPtr: - case Instruction::SIToFP: - case Instruction::UIToFP: - case Instruction::Trunc: - case Instruction::FPTrunc: - case Instruction::BitCast: - case Instruction::AddrSpaceCast: - case Instruction::ExtractElement: - case Instruction::InsertElement: - case Instruction::ExtractValue: - case Instruction::ShuffleVector: - case Instruction::Call: - return getUserCost(I, CostKind); - default: - // We don't have any information on this instruction. - return -1; - } -} - TargetTransformInfo::Concept::~Concept() {} TargetIRAnalysis::TargetIRAnalysis() : TTICallback(&getDefaultTTI) {} Index: llvm/lib/CodeGen/CodeGenPrepare.cpp =================================================================== --- llvm/lib/CodeGen/CodeGenPrepare.cpp +++ llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -6302,7 +6302,7 @@ // If it's safe to speculatively execute, then it should not have side // effects; therefore, it's safe to sink and possibly *not* execute. return I && I->hasOneUse() && isSafeToSpeculativelyExecute(I) && - TTI->getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency) >= + TTI->getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency) >= TargetTransformInfo::TCC_Expensive; } Index: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -1474,7 +1474,7 @@ SmallVector Operands(I.value_op_begin(), I.value_op_end()); - Cost += getUserCost(&I, Operands, TargetTransformInfo::TCK_CodeSize); + Cost += getInstructionCost(&I, Operands, TargetTransformInfo::TCK_CodeSize); } } Index: llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h =================================================================== --- llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h +++ llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h @@ -152,7 +152,7 @@ /// @} - int getUserCost(const User *U, ArrayRef Operands, + int getInstructionCost(const User *U, ArrayRef Operands, TTI::TargetCostKind CostKind); // Hexagon specific decision to generate a lookup table. Index: llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -312,7 +312,7 @@ } int -HexagonTTIImpl::getUserCost(const User *U, +HexagonTTIImpl::getInstructionCost(const User *U, ArrayRef Operands, TTI::TargetCostKind CostKind) { auto isCastFoldedIntoLoad = [this](const CastInst *CI) -> bool { @@ -336,7 +336,7 @@ if (const CastInst *CI = dyn_cast(U)) if (isCastFoldedIntoLoad(CI)) return TargetTransformInfo::TCC_Free; - return BaseT::getUserCost(U, Operands, CostKind); + return BaseT::getInstructionCost(U, Operands, CostKind); } bool HexagonTTIImpl::shouldBuildLookupTables() const { Index: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h =================================================================== --- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h +++ llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h @@ -53,7 +53,7 @@ int getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind); - unsigned getUserCost(const User *U, ArrayRef Operands, + unsigned getInstructionCost(const User *U, ArrayRef Operands, TTI::TargetCostKind CostKind); TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth); Index: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -210,20 +210,20 @@ } unsigned -PPCTTIImpl::getUserCost(const User *U, ArrayRef Operands, +PPCTTIImpl::getInstructionCost(const User *U, ArrayRef Operands, TTI::TargetCostKind CostKind) { // We already implement getCastInstrCost and getMemoryOpCost where we perform // the vector adjustment there. if (isa(U) || isa(U) || isa(U)) - return BaseT::getUserCost(U, Operands, CostKind); + return BaseT::getInstructionCost(U, Operands, CostKind); if (U->getType()->isVectorTy()) { // Instructions that need to be split should cost more. std::pair LT = TLI->getTypeLegalizationCost(DL, U->getType()); - return LT.first * BaseT::getUserCost(U, Operands, CostKind); + return LT.first * BaseT::getInstructionCost(U, Operands, CostKind); } - return BaseT::getUserCost(U, Operands, CostKind); + return BaseT::getInstructionCost(U, Operands, CostKind); } bool PPCTTIImpl::mightUseCTR(BasicBlock *BB, TargetLibraryInfo *LibInfo, Index: llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp =================================================================== --- llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp +++ llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp @@ -212,7 +212,7 @@ for (auto &InstBeforeCall : llvm::make_range(CallSiteBB->begin(), CB.getIterator())) { Cost += TTI.getInstructionCost(&InstBeforeCall, - TargetTransformInfo::TCK_CodeSize); + TargetTransformInfo::TCK_CodeSize); if (Cost >= DuplicationThreshold) return false; } Index: llvm/lib/Transforms/Scalar/LICM.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LICM.cpp +++ llvm/lib/Transforms/Scalar/LICM.cpp @@ -1261,10 +1261,10 @@ const TargetTransformInfo *TTI) { if (const GetElementPtrInst *GEP = dyn_cast(&I)) { - if (TTI->getUserCost(GEP, TargetTransformInfo::TCK_SizeAndLatency) != + if (TTI->getInstructionCost(GEP, TargetTransformInfo::TCK_SizeAndLatency) != TargetTransformInfo::TCC_Free) return false; - // For a GEP, we cannot simply use getUserCost because currently it + // For a GEP, we cannot simply use getInstructionCost because currently it // optimistically assume that a GEP will fold into addressing mode // regardless of its users. const BasicBlock *BB = GEP->getParent(); @@ -1277,7 +1277,7 @@ } return true; } else - return TTI->getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency) == + return TTI->getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency) == TargetTransformInfo::TCC_Free; } Index: llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -449,7 +449,7 @@ // First accumulate the cost of this instruction. if (!Cost.IsFree) { - UnrolledCost += TTI.getUserCost(I, TargetTransformInfo::TCK_CodeSize); + UnrolledCost += TTI.getInstructionCost(I, TargetTransformInfo::TCK_CodeSize); LLVM_DEBUG(dbgs() << "Adding cost of instruction (iteration " << Iteration << "): "); LLVM_DEBUG(I->dump()); @@ -542,7 +542,7 @@ // Track this instruction's expected baseline cost when executing the // rolled loop form. - RolledDynamicCost += TTI.getUserCost(&I, TargetTransformInfo::TCK_CodeSize); + RolledDynamicCost += TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize); // Visit the instruction to analyze its loop cost after unrolling, // and if the visitor returns true, mark the instruction as free after Index: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -2682,7 +2682,7 @@ if (CB->isConvergent() || CB->cannotDuplicate()) return false; - Cost += TTI.getUserCost(&I, TargetTransformInfo::TCK_CodeSize); + Cost += TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize); } assert(Cost >= 0 && "Must not have negative costs!"); LoopCost += Cost; Index: llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp +++ llvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp @@ -469,7 +469,7 @@ if (CostMapIt != SpecCostMap.end()) Cost += CostMapIt->second; } - Cost += TTI.getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency); + Cost += TTI.getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency); bool Inserted = SpecCostMap.insert({I, Cost}).second; (void)Inserted; assert(Inserted && "Must not re-insert a cost during the DFS!"); Index: llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp =================================================================== --- llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp +++ llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp @@ -244,7 +244,7 @@ case Instruction::FNeg: case Instruction::ICmp: case Instruction::FCmp: - return TTI.getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency); + return TTI.getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency); default: return UINT_MAX; // Disallow anything not explicitly listed. Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp =================================================================== --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -330,7 +330,7 @@ const TargetTransformInfo &TTI) { assert(isSafeToSpeculativelyExecute(I) && "Instruction is not safe to speculatively execute!"); - return TTI.getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency); + return TTI.getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency); } /// If we have a merge point of an "if condition" as accepted above, @@ -3072,7 +3072,7 @@ return false; // Not in white-list - not worthwhile folding. // And finally, if this is a non-free instruction that we are okay // speculating, ensure that we consider the speculation budget. - BudgetRemaining -= TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency); + BudgetRemaining -= TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency); if (BudgetRemaining < 0) return false; // Eagerly refuse to fold as soon as we're out of budget. } Index: llvm/test/Analysis/CostModel/SystemZ/ext-of-icmp-cost.ll =================================================================== --- llvm/test/Analysis/CostModel/SystemZ/ext-of-icmp-cost.ll +++ llvm/test/Analysis/CostModel/SystemZ/ext-of-icmp-cost.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -cost-model -cost-kind=code-size -analyze \ ; RUN: -mtriple=s390x-unknown-linux -mcpu=z13 | FileCheck %s ; -; Check that getUserCost() does not return TCC_Free for extensions of +; Check that getInstructionCost() does not return TCC_Free for extensions of ; i1 returned from icmp. define i64 @fun1(i64 %v) { Index: llvm/test/Analysis/CostModel/X86/costmodel.ll =================================================================== --- llvm/test/Analysis/CostModel/X86/costmodel.ll +++ llvm/test/Analysis/CostModel/X86/costmodel.ll @@ -19,7 +19,7 @@ ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64 ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32 ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef) -; LATENCY-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void undef() +; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void undef() ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef ; ; CODESIZE-LABEL: 'foo'