[PATCH] D21299: [Codegen Prepare] Swap commutative binops before splitting branch condition.

Balaram Makam via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 09:43:48 PDT 2016


bmakam created this revision.
bmakam added reviewers: jmolloy, majnemer, rengolin, t.p.northover, mcrosier.
bmakam added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

We generically canonicalize commutative binary operation nodes so that if
only one operand is a constant, it will be on the RHS. However, if both
operands are comparisons against constants, it is good to move the most
likely taken condition to the RHS if the binary operation is Instruction::And
and move the less likely taken condition to the RHS if the binary operation
is Instruction::Or.


http://reviews.llvm.org/D21299

Files:
  lib/CodeGen/CodeGenPrepare.cpp
  test/CodeGen/AArch64/aarch64-codegen-prepare-constant-cmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21299.60551.patch
Type: text/x-patch
Size: 4890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160613/1a4b3de8/attachment.bin>


More information about the llvm-commits mailing list