[Debugify] Skip debugifying on special/immutable passes
authorArthur Eubanks <aeubanks@google.com>
Mon, 16 Nov 2020 19:47:50 +0000 (11:47 -0800)
committerArthur Eubanks <aeubanks@google.com>
Tue, 17 Nov 2020 04:39:46 +0000 (20:39 -0800)
commit7de6dcd24644eee6af9e642cb9e0402a47018413
tree66cbf6df0b528da82242ba8314a10da6de82987e
parent74207e78cf26a52a59efaf95104d7ca0e5f801bf
[Debugify] Skip debugifying on special/immutable passes

With a function pass manager, it would insert debuginfo metadata before
getting to function passes while processing the pass manager, causing
debugify to skip while running the function passes.

Skip special passes + verifier + printing passes. Compared to the legacy
implementation of -debugify-each, this additionally skips verifier
passes. Probably no need to update the legacy version since it will be
obsolete soon.

This fixes 2 instcombine tests using -debugify-each under NPM.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D91558
llvm/lib/IR/PassInstrumentation.cpp
llvm/lib/Transforms/Utils/Debugify.cpp
llvm/test/DebugInfo/debugify-each.ll
llvm/test/DebugInfo/debugify-export.ll
llvm/test/Transforms/InstCombine/call-guard.ll