[LLVMdev] AliasAnalysis as a Loadable Module, Possible 2.6->2.7 issue

Will Dietz willdtz at gmail.com
Tue May 25 17:53:48 PDT 2010


Hi all,

First time posting to llvmdev, be gentle :).

I'm working on an AliasAnalysis implementation and running into an
issue on 2.7, that doesn't exist in 2.6 as far as I can tell.

Short version: has anyone been able to load an AliasAnalysis module
into 2.7's opt?

Longer version:

Even with a dummy pass implementation (just returns MayAlias for
everything), I'm getting very strange behavior:

All calls to FooAA::alias go to FooAA::print, resulting in
understandably painful failure thereafter, generally a segfault.

Example stack trace:
==25630==    by 0xB2752F: llvm::Pass::print(llvm::raw_ostream&,
llvm::Module const*) const (Pass.cpp:94)
==25630==    by 0x9B2769:
llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(llvm::Value*,
unsigned long, bool, llvm::ilist_iterator<llvm::Instruction>,
llvm::BasicBlock*) (MemoryDependenceAnalysis.cpp:282)

And the related lines from MemDep:
282      if (AccessPtr == Inst ||
283          AA->alias(Inst, 1, AccessPtr, 1) == AliasAnalysis::MustAlias)


The way I make this happen is to run:

opt -load fooAA.so -foo-aa -dse

(where "-foo-aa" is the AA pass defined in the module fooAA.so, and
dse makes use of the aa results through memdep)

Finally a short bit about my build env: GCC 4.4.3, Debug build, Linux x86_64.

I'd be happy to provide any more information required/desired, but
hopefully that covers the basics.

Any thoughts?  Is this a bug, or am I potentially doing something silly?

Thanks for your time,

~Will



More information about the llvm-dev mailing list