[PATCH] D11616: DAGCombiner: Improve DAGCombiner select normalization

Matthias Braun matze at braunis.de
Wed Jul 29 17:27:42 PDT 2015


MatzeB created this revision.
MatzeB added reviewers: resistor, charlieturner7c5, ab, chandlerc.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.

* Optimize SELECTs first before folding them into SELECT_CC:
This lets us catch a few more cases to optimize.

* Use CSE opportunities before looking at target preferences:
The current code normalizes select(C0, x, select(C1, x, y)) towards
select(C0|C1, x, y) if the targets prefers that form. This patch adds an
additional rule that if the select(C1, x, y) part already exists in the
function then we want to normalize into the other direction because the
effects of reusing the existing value are bigger than transforming into
the target preferred form.

This addresses regressions following r238793, see also:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150727/290272.html

Repository:
  rL LLVM

http://reviews.llvm.org/D11616

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/AArch64/dag-combine-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11616.30973.patch
Type: text/x-patch
Size: 9095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150730/75a9c240/attachment.bin>


More information about the llvm-commits mailing list