This is an archive of the discontinued LLVM Phabricator instance.

[Debugify] Add a mode to opt to enable faster testing
ClosedPublic

Authored by vsk on Jan 5 2018, 4:48 PM.

Details

Summary

Opt's "-enable-debugify" mode adds an instance of Debugify at the
beginning of the pass pipeline, and an instance of CheckDebugify at the
end.

You can enable this mode with lit using: -Dopt="opt -enable-debugify".
Note that running test suites in this mode will result in many failures
due to strict FileCheck commands, etc.

It can be more useful to look for assertion failures which arise only
when Debugify is enabled, e.g to prove that we have (or do not have)
test coverage for some code path with debug info present.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Jan 5 2018, 4:48 PM
davide accepted this revision.Jan 5 2018, 5:02 PM

LGTM

This revision is now accepted and ready to land.Jan 5 2018, 5:02 PM
MatzeB added a comment.Jan 8 2018, 9:19 AM

BTW: I usually do this instead of an env var to force some arguments to all invocations of a tool in lit:

llvm-lit -Dllc="llc -verify-machineinstrs"

davide added a comment.Jan 8 2018, 9:21 AM

BTW: I usually do this instead of an env var to force some arguments to all invocations of a tool in lit:

llvm-lit -Dllc="llc -verify-machineinstrs"

If we can go without an enviroment variable, it's even better.
BTW, I've never heard of this flag, is it documented somewhere? If not, we probably might want to.

MatzeB added a comment.Jan 8 2018, 9:28 AM

BTW: I usually do this instead of an env var to force some arguments to all invocations of a tool in lit:

llvm-lit -Dllc="llc -verify-machineinstrs"

If we can go without an enviroment variable, it's even better.
BTW, I've never heard of this flag, is it documented somewhere? If not, we probably might want to.

Probably not. I sneaked that into llvms lit.cfg a long time ago as it was only a 1-line thing but probably very few people know about it. Let me write a sentence or two for TestingGuide.rst

MatzeB added a comment.Jan 8 2018, 9:37 AM

BTW: I usually do this instead of an env var to force some arguments to all invocations of a tool in lit:

llvm-lit -Dllc="llc -verify-machineinstrs"

If we can go without an enviroment variable, it's even better.
BTW, I've never heard of this flag, is it documented somewhere? If not, we probably might want to.

Probably not. I sneaked that into llvms lit.cfg a long time ago as it was only a 1-line thing but probably very few people know about it. Let me write a sentence or two for TestingGuide.rst

Turns I out I already documented it in r236462 :)

You can avoid the env var by adding a substitution for opt in the lit.cfg.py with the extra argument.

davide added a comment.Jan 8 2018, 9:38 AM

BTW: I usually do this instead of an env var to force some arguments to all invocations of a tool in lit:

llvm-lit -Dllc="llc -verify-machineinstrs"

If we can go without an enviroment variable, it's even better.
BTW, I've never heard of this flag, is it documented somewhere? If not, we probably might want to.

Probably not. I sneaked that into llvms lit.cfg a long time ago as it was only a 1-line thing but probably very few people know about it. Let me write a sentence or two for TestingGuide.rst

Turns I out I already documented it in r236462 :)

:) Thanks!

vsk added a comment.Jan 8 2018, 6:44 PM

I think @MatzeB's suggestion works well without requiring any test changes. I'll update this patch soon.

vsk updated this revision to Diff 129023.Jan 8 2018, 6:56 PM
vsk retitled this revision from [Debugify] Add an env var to enable faster testing to [Debugify] Add a mode to opt to enable faster testing.
vsk edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.