<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 24, 2014 at 4:38 PM, Matthew O'Connor <span dir="ltr"><<a href="mailto:thegreendragon@gmail.com" target="_blank">thegreendragon@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi,<br><br>I'm attempting to do some alias analysis & other memory inspection. I've written a pointless AliasAnalysis pass (that says everything must alias) to attempt to verify that my pass is getting picked up & run by opt.<br>
<br></div>I run opt with: opt -load ~/Applications/llvm/lib/MustAA.so -must-aa -aa-eval -debug < trace0.ll<br><br></div>I see my pass being initialized, but never being called (I see only may alias results). <br><br></div>
Any ideas as to what to do to debug this? Or what I'm missing? I've read through <a href="http://llvm.org/docs/AliasAnalysis.html" target="_blank">http://llvm.org/docs/AliasAnalysis.html</a> and don't see anything that I'm missing.<br>
<br></div>Thanks,<br>Matthew<br><br>P.S. Here's the full source code of my pass:<br><br>#define DEBUG_TYPE "must-aa"<br>#include "llvm/Pass.h"<br>#include "llvm/Analysis/AliasAnalysis.h"<br>
#include "llvm/Support/raw_ostream.h"<br>#include "llvm/Support/Debug.h"<br>using namespace llvm;<br><br>namespace {<br>struct EverythingMustAlias : public ImmutablePass, public AliasAnalysis {<br> static char ID;<br>
EverythingMustAlias() : ImmutablePass(ID) {}<br><br> virtual void initializePass() {<br> DEBUG(dbgs() << "Initializing everything-must-alias\n");<br> InitializeAliasAnalysis(this);<br> }<br><br>
virtual void getAnalysisUsage(AnalysisUsage &AU) const {<br>
AliasAnalysis::getAnalysisUsage(AU);<br> AU.setPreservesAll();<br> }<br><br> virtual AliasResult alias(const Location &LocA, const Location &LocB) {<br> DEBUG(dbgs() << "Everything must alias!\n");<br>
return AliasAnalysis::MustAlias;<br> }<br>};<br>}<br><br>namespace llvm {<br>void initializeEverythingMustAliasPass(PassRegistry &Registry);<br>}<br><br>char EverythingMustAlias::ID = 0;<br>static RegisterPass<EverythingMustAlias> A("must-aa", "Everything must alias");</div>
</blockquote><div> </div><div>static RegisterPass<EverythingMustAlias> A("must-aa", "Everything must alias", false, true);<br></div><div><br></div><div>Can you try this? </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
INITIALIZE_AG_PASS(EverythingMustAlias, AliasAnalysis, "must-aa",<br> "Everything must alias", false, true, false)<br><br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>