[PATCH] D41222: Handle previously ASAN-instrumented IR gracefully when ASAN re-invoked

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 12:49:13 PST 2017


pcc added a comment.

The asan pass is more like something like codegenprepare in that we shouldn't really expect it to be run twice. If it does run twice, it most likely indicates a logic error in the pass pipeline, and it would be best to diagnose that with an assertion failure rather than silently ignoring it (which could also hide other unnecessary duplication of passes in the pipeline).

Besides which, this fix is not complete. If a module does not contain dynamically-initialized globals and the globaldce pass happens to run between the two invocations of the asan passes then the reference to the `__asan_before_dynamic_init` function will be dropped and the passes will still run twice.

If we really wanted to do something about this I think we should be inserting module-level metadata and testing for presence of that metadata (and, ideally, asserting if we see the metadata).


https://reviews.llvm.org/D41222





More information about the llvm-commits mailing list