[all-commits] [llvm/llvm-project] 19dc9c: [AArch64][GlobalISel] Move imm adjustment for G_IC...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Thu Oct 22 15:28:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 19dc9c97804fdb658b06f80b8f6e9115b7542bd5
      https://github.com/llvm/llvm-project/commit/19dc9c97804fdb658b06f80b8f6e9115b7542bd5
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-10-22 (Thu, 22 Oct 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64Combine.td
    A llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.h
    M llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/fold-select.mir
    A llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-lowering-adjust-icmp-imm.mir
    R llvm/test/CodeGen/AArch64/GlobalISel/select-arith-immed-compare.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/select-cbz.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/tbz-sgt.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Move imm adjustment for G_ICMP to post-legalizer lowering

Move the code which adjusts the immediate/predicate on a G_ICMP to
AArch64PostLegalizerLowering.

This

- Reduces the number of places we need to test for optimized compares in the
selector. We know that the compare should have been simplified by the time it
hits the selector, so we can avoid testing this in selects, brconds, etc.

- Allows us to potentially fold more compares (previously, this optimization
was only done after calling `tryFoldCompare`, this may allow us to hit some more
TST cases)

- Simplifies the selection code in `emitIntegerCompare` significantly; we can
just use an emitSUBS function.

- Allows us to avoid checking that the predicate has been updated after
`emitIntegerCompare`.

Also add a utility header file for things that may be useful in the selector
and various combiners. No need for an implementation file at this point, since
it's just one constexpr function for now. I've run into a couple cases where
having one of these would be handy, so might as well add it here. There are
a couple functions in the selector that can probably be factored out into
here.

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




More information about the All-commits mailing list