This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Try to recompute LiveOutInfo of PHI
Needs ReviewPublic

Authored by junbuml on Feb 14 2017, 2:32 PM.

Details

Summary

This change try to recompute LiveOutInfo for a PHI, which was invalidated, once its predecessors are all visited. This allows us to add AssertZext while building DAG, which enable eliminating redundant zexts during the DAGCombine phase.

Diff Detail

Event Timeline

junbuml created this revision.Feb 14 2017, 2:32 PM
junbuml updated this revision to Diff 88551.Feb 15 2017, 8:49 AM
junbuml edited the summary of this revision. (Show Details)
junbuml added reviewers: majnemer, mehdi_amini, mcrosier.
junbuml added a subscriber: llvm-commits.

Kindling ping. please let me know any comment and also add other reviewers who could look over the code.

mcrosier edited edge metadata.Feb 28 2017, 2:35 PM

Just a few general comments.

include/llvm/CodeGen/FunctionLoweringInfo.h
187

Please add a comment specifying what is contained in this set.

271

The function name should begin with a lower case letter and the doxygen comment shouldn't have the function name. This differs from the style of the surrounding code, but we should make the jump to the preferred style.

lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
413

Perhaps add a few comments describing the function and the assumptions it makes.

junbuml updated this revision to Diff 90358.Mar 2 2017, 10:43 AM
junbuml marked 3 inline comments as done.

Addressed Chad's comments.

Kindly ping. Please let me know any comment.

Do you have a test case?

It looks like you're making this algorithm directly recursive with a worst-case recursion depth given only by the number of blocks. Is the right? Can we say something about the worst case here?

junbuml updated this revision to Diff 93379.Mar 29 2017, 9:08 AM

Sorry, I dropped the test case by mistake in my previous update; added it now.
Yes, the worst-case recursion depth is the number of blocks if every block has back edges, and a value used in the last block is passed through PHIs in every block.

mcrosier resigned from this revision.Jul 26 2017, 6:06 AM