[all-commits] [llvm/llvm-project] 178953: [SelectOpt] Don't convert constant selects to bran...

David Green via All-commits all-commits at lists.llvm.org
Sat Oct 5 08:17:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1789534ac1ac95f9a3369625e331b9a446be60d9
      https://github.com/llvm/llvm-project/commit/1789534ac1ac95f9a3369625e331b9a446be60d9
  Author: David Green <david.green at arm.com>
  Date:   2024-10-05 (Sat, 05 Oct 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    A llvm/test/CodeGen/AArch64/selectopt-const.ll

  Log Message:
  -----------
  [SelectOpt] Don't convert constant selects to branches. (#110858)

Selects that choose between two constants will be less profitable to
turn into branches, especially if the constants can be folded somehow
into the surrounding instructions. They will also be cost modelled in a
way that can make them over-optimistically converted to branches, as
neither branch will have a latency depth but the constants still need to
be materialized.

This patch disabled selectopt for selects with two constant branches. It
is currently in the target independent part, as it sounds generic, but I
could move it into AArch64 if needed.



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