This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Enable UADDO/USUBO vector combine support
ClosedPublic

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

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Mar 5 2019, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2019, 7:11 AM
RKSimon marked an inline comment as done.Mar 5 2019, 7:13 AM
RKSimon added inline comments.
test/CodeGen/X86/combine-addo.ll
145 ↗(On Diff #189316)

Looks like we're missing a blendv + ~cmp combine -> commuted blendv - I'll add this separately.

nikic added inline comments.Mar 5 2019, 7:26 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2463 ↗(On Diff #189316)

Should this also become isNullorNullSplat? (Does ADDCARRY support vectors?)

RKSimon marked an inline comment as done.Mar 5 2019, 8:20 AM
RKSimon added inline comments.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2463 ↗(On Diff #189316)

AFAICT we don't have ISD::ADDCARRY/SUBCARRY support for vectors - it might be safest to just early-out from visitUADDOLike if VT.isVector()?

nikic added inline comments.Mar 5 2019, 11:23 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
2463 ↗(On Diff #189316)

Bailing out early on isVector() sounds reasonable. The code should be safe as-is, but that would make it more obvious that this transform doesn't apply to vectors.

RKSimon updated this revision to Diff 189472.Mar 6 2019, 3:08 AM

Early out from visitUADDOLike for vector types - we don't have ISD::ADDCARRY vector support

nikic accepted this revision.Mar 6 2019, 6:49 AM

LGTM

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