This is an archive of the discontinued LLVM Phabricator instance.

[MustExecute] Fix a debug invariant issue in isGuaranteedToExecute()
ClosedPublic

Authored by dstenb on May 22 2018, 7:34 AM.

Details

Summary

Look past debug intrinsics when querying whether an instruction is the
first instruction in the header block. The commit includes a reproducer
for a case where LICM would not hoist an instruction, due to the presence
of the intrinsic.

A caveat with this commit is that the check will not work properly if
the instruction at hand is a debug intrinsic. I assume that no one
depends on isGuaranteedToExecute() to return true for debug intrinsics
for these cases (and that this might be an indication of another debug
invariant issue), so I thought that it was not worth adding that extra
bit of complexity.

Diff Detail

Repository
rL LLVM

Event Timeline

dstenb created this revision.May 22 2018, 7:34 AM
dstenb retitled this revision from [LICM] Fix a debug invariant issue in isGuaranteedToExecute() to [MustExecute] Fix a debug invariant issue in isGuaranteedToExecute().May 22 2018, 11:35 PM
dstenb edited the summary of this revision. (Show Details)
anna accepted this revision.May 23 2018, 7:10 AM

LGTM.

This revision is now accepted and ready to land.May 23 2018, 7:10 AM

Thanks for the review! I'll submit this tomorrow when I have time for the build bots.

This revision was automatically updated to reflect the committed changes.