This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by deadalnix on May 2 2017, 9:55 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

deadalnix created this revision.May 2 2017, 9:55 AM
RKSimon added inline comments.May 2 2017, 3:29 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2158 ↗(On Diff #97466)

Might it be quicker if we check for ISD::ADD/ISD::UADDO first before calling the heavier isNullConstan/hasAnyUseOfValue checks?

deadalnix updated this revision to Diff 97604.May 3 2017, 4:43 AM

Check for opcode before uses.

RKSimon accepted this revision.May 3 2017, 5:50 AM

LGTM with one minor

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2158 ↗(On Diff #97604)

The comment doesn't grok well, maybe just:

// IIF the flag result is dead:
// (addcarry (add|uaddo X, Y), 0, Carry) -> (addcarry X, Y, Carry)
This revision is now accepted and ready to land.May 3 2017, 5:50 AM
deadalnix updated this revision to Diff 97670.May 3 2017, 9:40 AM

Fix comment.

This revision was automatically updated to reflect the committed changes.