This is an archive of the discontinued LLVM Phabricator instance.

[llvm][utils] Update llc test updater documentation
Needs ReviewPublic

Authored by zbrid on Apr 27 2020, 3:25 PM.

Details

Reviewers
MaskRay
RKSimon
Summary

This commit explains a common reason this utility fails to work on a given
file it was applied to. I didn't find any other place this utility was
documented, so I added this information in the script's header comment.

Diff Detail

Event Timeline

zbrid created this revision.Apr 27 2020, 3:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 3:25 PM

Added some users of update_llc_test_checks.py.

link attributes is not clear. Do you mean dso_local or dso_preemptable? The problem you described seems like a general stale test problem. Missing dso_local may be a problem but I don't know whether that is common. Maybe there are more common problems that are worth mentioning.

zbrid added a subscriber: jyknight.Apr 27 2020, 7:37 PM

Added some users of update_llc_test_checks.py.

link attributes is not clear. Do you mean dso_local or dso_preemptable? The problem you described seems like a general stale test problem. Missing dso_local may be a problem but I don't know whether that is common. Maybe there are more common problems that are worth mentioning.

The problem is: If dso_local (or any attribute that can be in the same place as dso_local) is an attribute on the function, then the script won't take any action even when there's no reason it should not take action. I am guessing this is a common problem because @jyknight immediately guessed that might be my issue when I was running this script. I assume other people encounter this problem enough it's tribal knowledge among people who use this script.

As for the link attributes terminology, that's what jyknight called it when he guessed my problem. I see that dso_local is called a runtime preemption specifier. https://llvm.org/docs/LangRef.html#runtime-preemption-specifiers

I'll update the patch to say that instead of link attribute and assume that those are the two things that might show up where dso_local shows up.

zbrid updated this revision to Diff 260532.Apr 27 2020, 7:41 PM

[utils] Update comment to be more specific based on maskray's comment

If this is a problem we should be doing more than just adding a comment in the script.

Possible things to consider:
1 - add support for matching dso_preemptable / dso_local - pretty trivial to add the relevant regex(s)
2 - detect any specifiers and warn that it might not be necessary

zbrid updated this revision to Diff 260649.Apr 28 2020, 8:25 AM

Add FIXME and bug link

zbrid added a comment.EditedApr 28 2020, 8:29 AM

If this is a problem we should be doing more than just adding a comment in the script.

Possible things to consider:
1 - add support for matching dso_preemptable / dso_local - pretty trivial to add the relevant regex(s)
2 - detect any specifiers and warn that it might not be necessary

Hi @RKSimon ,

That's a good point. I agree that it better if this is fixed in the script, however I can't fix it right now and I think that this comment is useful in the meantime. I filed a bug and updated the comment to reference it: https://bugs.llvm.org/show_bug.cgi?id=45714. The comment can be removed at the point this is fixed.

Given that multiple people have encountered this bug, it seems worthwhile to add a comment until the point it's fixed, so they don't have to spend time reaching out to people or reading the script until they understand the lack of output.

zbrid added a comment.Apr 28 2020, 8:32 AM

I'm also happy to close this if you want to fix the regexes in a patch instead since I agree that would be better.