This is an archive of the discontinued LLVM Phabricator instance.

Addressing a very strict assert check in CostAnnotationWriter::emitInstructionAnnot
ClosedPublic

Authored by knaumov on Apr 29 2020, 11:15 AM.

Details

Summary

The assert checks that every instruction must be annotated by this point while it is not necessary. If the inlining process was interrupted because the threshold was reached, the rest of the instructions would not be annotated which triggers the assert.
The test shows the situation in which it can happen. With the assert, the test will crash.

Diff Detail

Event Timeline

knaumov created this revision.Apr 29 2020, 11:15 AM
mtrofin accepted this revision.Apr 29 2020, 11:28 AM

lgtm

llvm/lib/Analysis/InlineCost.cpp
731

Nit: remove space between return and ; (probably clang-format would handle it)

This revision is now accepted and ready to land.Apr 29 2020, 11:28 AM
MaskRay added a subscriber: MaskRay.EditedApr 29 2020, 3:07 PM

Please include in the description of the revert commit (0fa793e798701358e42b1c289b28206bde028427) why it was reverted.

llvm/test/Transforms/Inline/print-instructions-deltas-unfinished.ll
2

Add a file-level comment about the purpose of the test.

Note, your original commit 66947d05fd193bb8948943a62455d617974f2012 and several recent commits don't correctly have Differential Revision: https://reviews.llvm.org/Dxxxxx

So the differential revision was not closed automatically when you pushed the commit to origin/master.

I usually do this when committing: arcfilter; git pull --rebase origin master; last-minute-testing && git push origin HEAD:master where arcfilter is a shell function which drops unneeded Phabricator tags

arcfilter () {
  arc amend
  git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend -F -
}
This revision was automatically updated to reflect the committed changes.
MaskRay added a comment.EditedApr 30 2020, 9:20 AM

@knaumov Please don't revert a patch just because the differential was not closed automatically. You can close a revision manually (click "Add Action" -> "Close Revision")