This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Propagate carry flag for 3+ additions
AbandonedPublic

Authored by chfast on Nov 8 2019, 8:32 AM.

Details

Reviewers
deadalnix
Summary

This is an attempt to more aggressively optimize additions with carry flag propagation. So far DAG Combiner is able to optimize it mostly for two additions.
This change makes it work for 3 additions.

The goal is to have it working for at lest 4 additions, so this is not finished yet. But I'm sending it at this point to possibly get comments in case the direction where this is going is work.

Event Timeline

chfast created this revision.Nov 8 2019, 8:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2019, 8:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
lebedev.ri edited reviewers, added: deadalnix; removed: llvm-commits.Nov 8 2019, 8:48 AM
lebedev.ri added a subscriber: llvm-commits.

Can you please explain a bit more what this is doing? This seems interesting, but I'm not quite sure the pattern is correct.

Also while I'm at it, first sorry for taking so long to review, I missed that patch. Second, if I understand properly, getting node to be processed in the right order actually can collapse arbitrary long addition chains, but it's not clear how to get there, there is a bit of a wack a mole problem that start poping up every time.

chfast abandoned this revision.Nov 19 2019, 11:19 PM

Thanks for comments @deadalnix, but please review D70079. I'm closing this one as being the duplicate of the mentioned PR.