[all-commits] [llvm/llvm-project] b1b86d: [AArch64][GlobalISel] Fold shifts into G_ICMP

Jessica Paquette via All-commits all-commits at lists.llvm.org
Tue May 5 18:45:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b1b86d1c28150d3e54e5d33072b4afb6011b7ab0
      https://github.com/llvm/llvm-project/commit/b1b86d1c28150d3e54e5d33072b4afb6011b7ab0
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-05-05 (Tue, 05 May 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/opt-shifted-reg-compare.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Fold shifts into G_ICMP

Since G_ICMP can be selected to a SUBS, we can fold shifts into such compares.

E.g.

```
cmp	w1, w0, lsl #3
cmp	w1, w0, lsr #3
cmp	w1, w0, asr #3
```

This is done the same way as for adds and subtracts, using
`selectShiftedRegister`.

This gives some minor code size savings on CTMark.

https://reviews.llvm.org/D79365




More information about the All-commits mailing list