Page MenuHomePhabricator

[SelectionDAG] Expand UADDO/USUBO into ADD/SUBCARRY if legal for target
ClosedPublic

Authored by kparzysz on May 30 2018, 2:16 PM.

Details

Summary

Additionally, this implements handling of ADD/SUBCARRY on Hexagon, utilizing the UADDO/USUBO expansion.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz updated this revision to Diff 149202.May 30 2018, 2:16 PM
kparzysz created this revision.

Forgot new testcase for Hexagon.

efriedma added inline comments.May 30 2018, 2:50 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2290 ↗(On Diff #149202)

You probably also need to fix visitSUBCARRY.

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
3506 ↗(On Diff #149202)

The third operand to SUBCARRY is actually a x86-style borrow, so it should be zero here.

kparzysz updated this revision to Diff 149275.May 31 2018, 6:07 AM
kparzysz marked 2 inline comments as done.

Fixed issues pointed out in comments.

This revision is now accepted and ready to land.May 31 2018, 12:03 PM
deadalnix accepted this revision.Jun 1 2018, 5:46 AM
deadalnix added a subscriber: deadalnix.

LGTM.

This revision was automatically updated to reflect the committed changes.