[all-commits] [llvm/llvm-project] 98b6f8: [CostModel] Remove optional from InstructionCost::...

David Green via All-commits all-commits at lists.llvm.org
Tue Apr 22 23:46:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98b6f8dc699d789d834e5b6d810ed217f560aad0
      https://github.com/llvm/llvm-project/commit/98b6f8dc699d789d834e5b6d810ed217f560aad0
  Author: David Green <david.green at arm.com>
  Date:   2025-04-23 (Wed, 23 Apr 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/include/llvm/Support/InstructionCost.h
    M llvm/include/llvm/Transforms/Utils/UnrollLoop.h
    M llvm/lib/Analysis/CostModel.cpp
    M llvm/lib/CodeGen/SelectOptimize.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
    M llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/lib/Transforms/IPO/PartialInlining.cpp
    M llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
    M llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
    M llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    M llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/unittests/Support/InstructionCostTest.cpp

  Log Message:
  -----------
  [CostModel] Remove optional from InstructionCost::getValue() (#135596)

InstructionCost is already an optional value, containing an Invalid
state that can be checked with isValid(). There is little point in
returning another optional from getValue(). Most uses do not make use of
it being a std::optional, dereferencing the value directly (either
isValid has been checked previously or the Cost is assumed to be valid).
The one case that does in AMDGPU used value_or which has been replaced
by a isValid() check.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list