This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Add SADDO/SSUBO combine support
ClosedPublic

Authored by RKSimon on Mar 5 2019, 7:38 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Mar 5 2019, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2019, 7:38 AM

I think we'd do better by making a helper for the common code rather than duplicating. These things tend to diverge because someone will come along later and add a fold for 1 opcode but forget to add the corresponding fold for its sibling. This might've already happened because we allow vectors for the signed ops, but not the unsigned ops...or that's the planned follow-up?

I think we'd do better by making a helper for the common code rather than duplicating. These things tend to diverge because someone will come along later and add a fold for 1 opcode but forget to add the corresponding fold for its sibling. This might've already happened because we allow vectors for the signed ops, but not the unsigned ops...or that's the planned follow-up?

I'm happy to fold this into a generalized version of visitUADDO/visitUSUBO once D58965 has landed.

Ah, I'm getting the order of the patches mixed up. Are we missing tests for when the flag result is unused, or is that already covered elsewhere?

Ah, I'm getting the order of the patches mixed up. Are we missing tests for when the flag result is unused, or is that already covered elsewhere?

On scalars we do have some tests that cover this. For vectors I haven't thought of a good way to test this yet as expansion strips it away if its not used.

spatel accepted this revision.Mar 6 2019, 5:53 AM

Code/tests look correct, so LGTM. Please do refactor to reduce duplication once the other patches are committed.

This revision is now accepted and ready to land.Mar 6 2019, 5:53 AM
This revision was automatically updated to reflect the committed changes.