[llvm-dev] Should Verifier be an analysis?

Hal Finkel via llvm-dev
Thu, 12 Jul 2018 18:13:18 -0000

On 07/12/2018 12:43 PM, Chijun Sima via llvm-dev wrote:
> Hi,
>
> I am wondering whether it is feasible to preserve the DominatorTree
> which is recalculated in the Verifier by making Verifier into an
> analysis. This recalculation actually consumes an approximately 7% of
> the time used by the whole DominatorTree related calculations when
> optimizing SQLite with opt -O3.

The verifier itself should not be invalidating the DT. It has this:

struct VerifierLegacyPass : public FunctionPass {
...
  void getAnalysisUsage(AnalysisUsage &AU) const override {
    AU.setPreservesAll();

I assume that the problem is that other passes are invalidating the DT
in between verifier runs?

Are you benchmarking with asserts enabled? I was under the impression
that we skipped the verifier runs in release builds with asserts disabled.

 -Hal

>
> Best,
> Chijun Sima
>
> On Thu, Jul 12, 2018 at 11:19 PM Son Tuan VU via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> Hello all,
>>
>> I came across the code of Verifier, and see that it doesn't modify
the IR at all. Why it is not considered as an analysis pass?
>>
>> Actually, this will have impact on debugify-each and
print-before/after-all: we are not supposed to print/debugify Verifier pass, but
since Verifier is declared as a transformation (well, a non-analysis) pass, we
actually do print/debugify it.
>>
>> Thanks for your help!
>>
>> Son Tuan Vu
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory