I had to hack the bswap recognition to allow unshrunk masks to make this work.
Fixes PR36689.
Paths
| Differential D44442
[X86] Teach X86TargetLowering::targetShrinkDemandedConstant to set non-demanded bits if it helps created an and mask that can be matched as a zero extend. ClosedPublic Authored by craig.topper on Mar 13 2018, 10:47 AM.
Details Summary I had to hack the bswap recognition to allow unshrunk masks to make this work. Fixes PR36689.
Diff Detail
Event TimelineComment Actions Is there any chance of the right shift needing this case as well? In any case, this LGTM modulo nit.
This revision is now accepted and ready to land.Mar 14 2018, 8:21 AM Comment Actions The pattern matching detects (and (shift)) and (shift (and)) since we canonicalize the order of shifts and ands. This patch handles 0xffff for (and (srl)) and (shl (and)) Closed by commit rL327530: [X86] Teach X86TargetLowering::targetShrinkDemandedConstant to set non-demanded… (authored by ctopper). · Explain WhyMar 14 2018, 9:59 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 138228 lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/pr12360.ll
test/CodeGen/X86/pr32284.ll
test/CodeGen/X86/zext-demanded.ll
|
I think we should put this case right after the 0xFF00 case.