This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)
ClosedPublic

Authored by deadalnix on Apr 30 2017, 12:59 PM.

Details

Summary

This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo .

Diff Detail

Repository
rL LLVM

Event Timeline

deadalnix created this revision.Apr 30 2017, 12:59 PM
RKSimon accepted this revision.May 2 2017, 5:51 AM

LGTM with a couple of minors

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2095 ↗(On Diff #97241)

Use SDValue if possible please.

This revision is now accepted and ready to land.May 2 2017, 5:51 AM
deadalnix updated this revision to Diff 97446.May 2 2017, 7:10 AM

Rebase and use SDValue.

This revision was automatically updated to reflect the committed changes.