[all-commits] [llvm/llvm-project] 3d494b: [SimplifyCFG] Increase budget for FoldTwoEntryPHIN...

Tianqing Wang via All-commits all-commits at lists.llvm.org
Mon Jul 22 16:47:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d494bfc7ff73cb0a8dbe16ac41db6f47910eef1
      https://github.com/llvm/llvm-project/commit/3d494bfc7ff73cb0a8dbe16ac41db6f47910eef1
  Author: Tianqing Wang <tianqing.wang at intel.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.h
    M llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Other/new-pm-print-pipeline.ll
    A llvm/test/Transforms/SimplifyCFG/two-entry-phi-fold-unpredictable.ll

  Log Message:
  -----------
  [SimplifyCFG] Increase budget for FoldTwoEntryPHINode() if the branch is unpredictable. (#98495)

The `!unpredictable` metadata has been present for a long time, but
it's usage in optimizations is still limited. This patch teaches
`FoldTwoEntryPHINode()` to be more aggressive with an unpredictable
branch to reduce mispredictions.

A TTI interface `getBranchMispredictPenalty()` is added to distinguish
between different hardwares to ensure we don't go too far for simpler
cores. For simplicity, only a naive x86 implementation is included for
the time being.



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