[all-commits] [llvm/llvm-project] 0bc1ec: [GlobalISel] Reduce KnownBits usage in matcher com...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Thu May 16 04:34:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0bc1ec5cda8d68a681534bda9fd121b7f58fb495
      https://github.com/llvm/llvm-project/commit/0bc1ec5cda8d68a681534bda9fd121b7f58fb495
  Author: Pierre van Houtryve <pierre.vanhoutryve at amd.com>
  Date:   2024-05-16 (Thu, 16 May 2024)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

  Log Message:
  -----------
  [GlobalISel] Reduce KnownBits usage in matcher combines (#92381)

Two icmp/and combines forced computation of KnownBits on all operands
everytime. We can avoid computing KnownBits on the LHS by exploiting a
couple of properties:
- Constants are always on the RHS for those instructions. If we have no
KnownBits on the RHS, we can bail out early and avoid computing LHS
knownbits.
- For icmp uge/ult 0, we don't need to know the KBs of the LHS to infer
the result

This allows to save some KnownBits calls, which are very expensive,
without affecting codegen.



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