[all-commits] [llvm/llvm-project] 241c7b: [AArch64][GlobalISel] Run overlapping_and after le...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Tue Sep 28 17:14:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 241c7b1473edf25a978db745e8fbcc1f0d013b34
      https://github.com/llvm/llvm-project/commit/241c7b1473edf25a978db745e8fbcc1f0d013b34
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64Combine.td
    A llvm/test/CodeGen/AArch64/GlobalISel/opt-overlapping-and-postlegalize.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Run overlapping_and after legalization

When we have code with truncates, those truncates may be changed into G_ANDs
with constants. These may, in turn, feed into other G_AND instructions.

Running this combine post-legalize allows us to optimize examples like this one:

https://godbolt.org/z/zrGY4dfEW

SDAG currently optimizes the example above so that there is only one `and`.
GISel doesn't optimize it, because the G_AND we'd optimize here is translated
as a G_TRUNC. Later, that G_TRUNC is turned into a G_AND during legalization.

Differential Revision: https://reviews.llvm.org/D110667




More information about the All-commits mailing list