If the and has an additional use we shouldn't invert it. That creates an additional instruction.
While there add a one use check to the transform above that looked similar.
Paths
| Differential D43225
[DAGCombiner] Add one use check to fold (not (and x, y)) -> (or (not x), (not y)) ClosedPublic Authored by craig.topper on Feb 12 2018, 11:33 PM.
Details Summary If the and has an additional use we shouldn't invert it. That creates an additional instruction. While there add a one use check to the transform above that looked similar.
Diff Detail
Event TimelineComment Actions LGTM - I'm curious whether it's be useful for those combines to support vectors at some point, X86 combineANDXORWithAllOnesIntoANDNP might match more cases then. This revision is now accepted and ready to land.Feb 13 2018, 4:34 AM Closed by commit rL325019: [DAGCombiner] Add one use check to fold (not (and x, y)) -> (or (not x), (not… (authored by ctopper). · Explain WhyFeb 13 2018, 8:28 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 133998 lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/tbm_patterns.ll
|