This is an archive of the discontinued LLVM Phabricator instance.

Update TailCallElim to avoid making redundant changes
AbandonedPublic

Authored by kmod on Mar 21 2014, 5:14 PM.

Details

Reviewers
None
Group Reviewers
deleted
Summary

While experimenting with an iterated optimization pipeline, I noticed that
the standard optimization pipeline would always change (most) functions.
I tracked it down to TailCallElim always calling setTailCall(), even if the call
is already a tail call; with this change the pipeline does convege after a few
iterations.

Diff Detail

Event Timeline

Code is obviously correct, but can you add a testcase?

I think you can observe this misbehaviour in opt by setting
-debug-pass=Executions, which should print a "Made Modifications"
line to dbgs() when a pass reports change things. You’ll also need
a "REQUIRES: asserts" line.

kmod abandoned this revision.Jun 13 2014, 2:46 PM

Looks like this feature got included in some recent broader work on TailCallElim.