[all-commits] [llvm/llvm-project] a3010c: [GlobalISel] Add boolean predicated legalization a...

David Green via All-commits all-commits at lists.llvm.org
Wed Oct 16 06:43:51 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
    M llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

  Log Message:
  -----------
  [GlobalISel] Add boolean predicated legalization action methods. (#111287)

Under AArch64 it is common and will become more common to have operation
legalization rules dependant on a feature of the architecture. For
example HasFP16 or the newer CSSC integer min/max instructions, among
many others. With the current legalization rules this either means
adding a custom predicate based on the feature as in
`legalIf([=](const LegalityQuery &Query) { return HasFP16 && ...; }` or
splitting the legalization rules into pieces that place rules optionally
into them base on the features available.

This patch proposes an alternative where the existing routines like
legalFor(..) are provided a boolean predicate, which if false skips
adding the rule. It makes the rules cleaner and will hopefully allow
them to scale better as we add more features.

The SVE predicates for loads/stores I have changed to just be always
available. Scalable vectors without SVE have never been supported, but
it could also add a condition.



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