DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 6 Jul 2013 14:05:09 +0000 (14:05 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 6 Jul 2013 14:05:09 +0000 (14:05 +0000)
commitf4eeab452ad4093986359c78a57321df12df99b0
tree18e20c9044ed731be0e644bf0d52fe54f4155ad1
parente5a81a130f26b0b2651ad6a22e3748703b11cb46
DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.

ReduceLoadWidth unconditionally drops extensions from loads. Limit it to the
case when all of the bits the extension would otherwise produce are dropped by
the shrink. It would be possible to shrink the load in more cases by merging
the extensions, but this isn't trivial and a very rare case. I left a TODO for
that case.

Fixes PR16551.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185755 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/shrink-compare.ll