[SystemZ] Fix choice of known-zero mask in insertion optimization
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Tue, 3 Dec 2013 11:01:54 +0000 (11:01 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Tue, 3 Dec 2013 11:01:54 +0000 (11:01 +0000)
commit90a34679ef394ce076d674d46283e3bc7cfa421f
treec213e4dee8021edd2679eaacd760c24cf7fd10fe
parent239ffb30b0cefd4e5eb9b410e92bc7df51936233
[SystemZ] Fix choice of known-zero mask in insertion optimization

The backend converts 64-bit ORs into subreg moves if the upper 32 bits
of one operand and the low 32 bits of the other are known to be zero.
It then tries to peel away redundant ANDs from the upper 32 bits.

Since AND masks are canonicalized to exclude known-zero bits,
the test ORs the mask and the known-zero bits together before
checking for redundancy.  The problem was that it was using the
wrong node when checking for known-zero bits, so could drop ANDs
that were still needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196267 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
test/CodeGen/SystemZ/insert-06.ll