Andresen Algorithm

Date: Mon, 14 May 2018 14:26:13 -0400
From: Kenneth Adam Miller via llvm-dev <>
To: llvm-dev <>
Subject: [llvm-dev] Andresen Algorithm
Content-Type: text/plain; charset="utf-8"

Hello all,

I'm looking for something simple - does anybody know if there is an
implementation of Andresen's algorithm anywhere in LLVM?

Apart from the Andersen's analysis
in lib/Analysis/CFLAndersAliasAnalysis.cpp, we also implemented a primitive
Shapiro-Horowitz alias analysis here: . We didn't have much
documentation. The report is here:

Is there a particular way to run a specific alias analysis that is already implemented on a .ll file produced by clang -S -emit-llvm?

Actually I figured out that it is:

opt -cfl-anders-aa *.ll

But now I noticed that I need the graph that it computes, and it doesn’t seem to emit that.

Usually you need to add the -analyze option, to dump the analysis results.

Got this error:

Printing analysis ‘Inclusion-Based CFL Alias Analysis’:
Pass::print not implemented for pass: ‘Inclusion-Based CFL Alias Analysis’!

Ok, the command necessary to get past this is:

opt ./example.ll -disable-basicaa -cfl-anders-aa -aa-eval -disable-output -print-alias-sets

It was non-intuitive, because I thought turning on cfl-anders-aa would also enable printing the alias sets automatically. It also helps to add this flag: -mem2reg