[PATCH] D34515: [ARM] Materialise some boolean values to avoid a branch

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 08:41:20 PDT 2017


rogfer01 created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

This patch combines some cases of `ARMISD::CMOV` for integers that arise in comparisons of the form

  a != b ? x : 0
  a == b ? 0 : x

and that currently (e.g. in Thumb1) are emitted as branches.


https://reviews.llvm.org/D34515

Files:
  lib/Target/ARM/ARMISelLowering.cpp
  test/CodeGen/ARM/atomic-cmpxchg.ll
  test/CodeGen/ARM/cmn.ll
  test/CodeGen/ARM/cmpxchg-O0.ll
  test/CodeGen/ARM/fp16-promote.ll
  test/CodeGen/ARM/long-setcc.ll
  test/CodeGen/ARM/select-imm.ll
  test/CodeGen/ARM/setcc-logic.ll
  test/CodeGen/Thumb/branchless-cmp.ll
  test/CodeGen/Thumb/constants.ll
  test/CodeGen/Thumb/long-setcc.ll
  test/CodeGen/Thumb2/float-cmp.ll
  test/CodeGen/Thumb2/thumb2-cmn.ll
  test/CodeGen/Thumb2/thumb2-cmn2.ll
  test/CodeGen/Thumb2/thumb2-cmp.ll
  test/CodeGen/Thumb2/thumb2-cmp2.ll
  test/CodeGen/Thumb2/thumb2-teq.ll
  test/CodeGen/Thumb2/thumb2-teq2.ll
  test/CodeGen/Thumb2/thumb2-tst.ll
  test/CodeGen/Thumb2/thumb2-tst2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34515.103582.patch
Type: text/x-patch
Size: 47166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170622/c92d7cde/attachment.bin>


More information about the llvm-commits mailing list