[PowerPC] Fix and(or(x, c1), c2) -> rlwimi generation
authorHal Finkel <hfinkel@anl.gov>
Sat, 5 Sep 2015 00:02:59 +0000 (00:02 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 5 Sep 2015 00:02:59 +0000 (00:02 +0000)
commit6d7a4a2886266317f7aae6e3c806719de539e517
tree245d02a76bc57a58de629041ba9bfe27db0012d0
parentb1b15ace485583be8309cee38f94fb3f54f3a990
[PowerPC] Fix and(or(x, c1), c2) -> rlwimi generation

PPCISelDAGToDAG has a transformation that generates a rlwimi instruction from
an input pattern that looks like this:

  and(or(x, c1), c2)

but the associated logic does not work if there are bits that are 1 in c1 but 0
in c2 (these are normally canonicalized away, but that can't happen if the 'or'
has other users. Make sure we abort the transformation if such bits are
discovered.

Fixes PR24704.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246900 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
test/CodeGen/PowerPC/rlwimi-and-or-bits.ll [new file with mode: 0644]