Instead of just using isConstOrConstSplat to get constant data, use computeKnownBits which can peek through bitcasts.
Additionally, if all of the demanded bits are known on RHS, try to simplify LHS.
Paths
| Differential D41401
[DAG] Improve SimplifyDemandedBits ISD::AND handling through bitcasts (PR34620) AbandonedPublic Authored by RKSimon on Dec 19 2017, 9:49 AM.
Details
Summary Instead of just using isConstOrConstSplat to get constant data, use computeKnownBits which can peek through bitcasts. Additionally, if all of the demanded bits are known on RHS, try to simplify LHS.
Diff Detail
Revision Contents
Diff 127553 lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/combine-and.ll
|