[PATCH] D14332: [ARM] Combine CMOV into BFI where possible

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 07:32:24 PST 2015


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

If we have a CMOV, OR and AND combination such as:

  if (x & CN)
    y |= CM;

And:
  * CN is a single bit;
  * All bits covered by CM are known zero in y;

Then we can convert this to a sequence of BFI instructions. This will always be a win if CM is a single bit, will always be no worse than the TST & OR sequence if CM is two bits, and for thumb will be no worse if CM is three bits (due to the extra IT instruction).

Repository:
  rL LLVM

http://reviews.llvm.org/D14332

Files:
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.h
  test/CodeGen/ARM/bfi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14332.39204.patch
Type: text/x-patch
Size: 5141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151104/2a90f00b/attachment-0001.bin>


More information about the llvm-commits mailing list