This is an archive of the discontinued LLVM Phabricator instance.

[X86] Teach combineTruncatedArithmetic to push truncate through subtracts where only one of the inputs is free to truncate.
ClosedPublic

Authored by craig.topper on May 23 2020, 3:18 PM.

Details

Summary

Fix combineSubToSubus to handle the new DAG to avoid a regression.

There are still regressions in test14/test15/test16. Where it
looks like were trying to set up cases we could match to
umin+trunc+subus but the handling was never finished. The
regression here isn't unique to sub. Its a lost opportunity for
taking an AND with two truncated inputs and producing a larger
AND with a single truncate. The same thing could happen with
any other node we handle in combineTruncatedArithmetic since we
are moving the truncate up the DAG.

Diff Detail

Event Timeline

craig.topper created this revision.May 23 2020, 3:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2020, 3:18 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
spatel accepted this revision.May 25 2020, 4:54 AM

LGTM - mark the code and/or tests with TODO comments, so we know where the potential improvements are?

This revision is now accepted and ready to land.May 25 2020, 4:54 AM

Going forward I'm still hoping that we can move most of this to DAGCombine

This revision was automatically updated to reflect the committed changes.