[PATCH] D18949: [AArch64] Cannonicalize commutative operands based on LSLFast

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 10 23:53:01 PDT 2016


haicheng created this revision.
haicheng added reviewers: mcrosier, gberry, mssimpso, t.p.northover.
haicheng added a subscriber: llvm-commits.
haicheng set the repository for this revision to rL LLVM.
Herald added subscribers: mcrosier, rengolin, aemerson.

LSLFast - a logical shift left up to 3 places.

In Kryo if an commutative instruction has a LSL for both operands and if the LSL can be folded into the instruction's shifted register (e.g., add x0, x1, x2, lsl #3) then we should canonicalize the operands so the smaller (in terms of the number of shifts) is the operands that is folded.

For example, rather than

lsl x1, x1, #1
add x0, x1, x2, lsl #4

we should prefer

lsl x2, x2, #4
add x0, x2, x1, lsl #1

as this safes a cycle on the add instruction.

Now Add/And/Xor/Or/And support this.

Repository:
  rL LLVM

http://reviews.llvm.org/D18949

Files:
  lib/Target/AArch64/AArch64ISelLowering.cpp
  test/CodeGen/AArch64/kryo-lsl.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18949.53195.patch
Type: text/x-patch
Size: 8025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160411/9683bfa5/attachment.bin>


More information about the llvm-commits mailing list