This is an archive of the discontinued LLVM Phabricator instance.

fast-isel: remove dead code after falling back from selecting call instructions (PR20863)
ClosedPublic

Authored by hans on Sep 8 2014, 12:02 PM.

Details

Summary

Previously, fast-isel would not clean up after trying but failing to select a call instruction, because it would have called flushLocalValueMap() which moves the insertion point, making SavedInsertPt in selectInstruction() invalid. We can fix this by making SavedInsertPt a member variable, and having flushLocalValueMap() update it.

This removes some redundant code at-O0, and more importantly fixes PR20863. Please take a look!

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 13411.Sep 8 2014, 12:02 PM
hans retitled this revision from to fast-isel: remove dead code after falling back from selecting call instructions (PR20863).
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added a reviewer: rnk.
hans added subscribers: Unknown Object (MLST), hansw.

I think this looks reasonable.

ributzka accepted this revision.Sep 8 2014, 1:10 PM
ributzka added a reviewer: ributzka.
ributzka added a subscriber: ributzka.

LGTM

Could you also add an unit test that checks that the local value area didn't get accidentally deleted as dead code too?

This revision is now accepted and ready to land.Sep 8 2014, 1:10 PM
hans updated this revision to Diff 13417.Sep 8 2014, 1:23 PM
hans edited edge metadata.

Could you also add an unit test that checks that the local value area didn't get accidentally deleted as dead code too?

Like this? (See attached patch)

hans closed this revision.Sep 8 2014, 1:34 PM
hans updated this revision to Diff 13418.

Closed by commit rL217401 (authored by @hans).

rnk edited edge metadata.Sep 8 2014, 2:01 PM

Nice, that was easy. :)