This is an archive of the discontinued LLVM Phabricator instance.

[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

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 12 2018, 11:33 PM
RKSimon accepted this revision.Feb 13 2018, 4:34 AM

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
This revision was automatically updated to reflect the committed changes.