This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Revise common code sinking
Needs ReviewPublic

Authored by hliao on Dec 16 2014, 11:59 AM.

Details

Reviewers
nadav
Summary
  • Fix the case where more than 1 common instructions derived from the same operand cannot be sunk

Diff Detail

Repository
rL LLVM

Event Timeline

hliao updated this revision to Diff 17351.Dec 16 2014, 11:59 AM
hliao retitled this revision from to [SimplifyCFG] Revise common code sinking.
hliao updated this object.
hliao edited the test plan for this revision. (Show Details)
hliao set the repository for this revision to rL LLVM.
hliao added a subscriber: Unknown Object (MLST).

Hi Nadav & Manman

Could you help me reviewing the fix of common code sinking in SimplifyCFG?

Yours

  • Michael
hliao added a comment.Dec 17 2014, 5:12 PM

PING, people probably in vacation, can someone help me review the change?

hliao added a comment.Dec 18 2014, 5:13 PM

The existing common code sinking in SimplifyCFG maintains a mapping from BB1 value to BB2 value pairing the phi node. This prevents case where a single value has two or more derived values in both if and else branches as, once one derived is sunk, that single value is added into that map and prevent further sinking. The added test reveal that issue. With the existing implementation, only one function call could be sunk instead of both. After the fix, both function calls are sunk. The fix changes the BB1->BB2 pairing phi map with a (BB1,BB2) -> phi map, which is more accurate to track the common code.

Yours

  • Michael