This is an archive of the discontinued LLVM Phabricator instance.

Codegen: Tail Duplication: Only duplicate into layout pred if it is a CFG Pred.
ClosedPublic

Authored by iteratee on Jul 13 2016, 3:43 PM.

Details

Reviewers
davidxl
Summary

Add a check that the layout predecessor of a block is an actual CFG
predecssor of the block as well. No current code fails this check, but
upcoming patches can trigger this, and it makes sense to separate it
out.

Diff Detail

Event Timeline

iteratee updated this revision to Diff 63875.Jul 13 2016, 3:43 PM
iteratee retitled this revision from to Codegen: Tail Duplication: Only duplicate into layout pred if it is a CFG Pred..
iteratee updated this object.
iteratee added a reviewer: davidxl.
iteratee set the repository for this revision to rL LLVM.
iteratee added subscribers: echristo, timshen, llvm-commits.
echristo added inline comments.Jul 13 2016, 3:51 PM
lib/CodeGen/TailDuplicator.cpp
817

Can you update and elaborate on the comment for this?

iteratee updated this revision to Diff 63876.Jul 13 2016, 4:00 PM
iteratee removed rL LLVM as the repository for this revision.

Add a comment above the check.

lib/CodeGen/TailDuplicator.cpp
817

The comment now matches the code. "except for the prior block, which falls through unconditionally, move the contents of this block into the prior block."

But I'll add a comment to this line to the effect of "Layout preds are not always CFG preds", above this line.

iteratee marked an inline comment as done.Jul 13 2016, 4:00 PM
davidxl accepted this revision.Jul 13 2016, 4:36 PM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jul 13 2016, 4:36 PM
iteratee closed this revision.Jul 19 2016, 5:09 PM