Also pass logical ops to combineSelectAndUse.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 18 Aug 2012 21:25:16 +0000 (21:25 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 18 Aug 2012 21:25:16 +0000 (21:25 +0000)
commitdcd2342d32e92912cc457fe6ce4cd8a72c93c06b
treeb1520563cd2f1746192db1f7e0e1832db332552b
parentc279ecd23c7902fbc6b436cfd8b7957607711281
Also pass logical ops to combineSelectAndUse.

Add these transformations to the existing add/sub ones:

  (and (select cc, -1, c), x) -> (select cc, x, (and, x, c))
  (or  (select cc, 0, c), x)  -> (select cc, x, (or, x, c))
  (xor (select cc, 0, c), x)  -> (select cc, x, (xor, x, c))

The selects can then be transformed to a single predicated instruction
by peephole.

This transformation will make it possible to eliminate the ISD::CAND,
COR, and CXOR custom DAG nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162176 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/select_xform.ll