<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/10/14, 7:27 PM, Manish Gupta
wrote:<br>
</div>
<blockquote
cite="mid:CAL6s+WnN5=X=KDUwwySW_3j2ULG5HaarrXbxnTM+xBCNc0xy4g@mail.gmail.com"
type="cite">
<div dir="ltr">Dear All,
<div><br>
</div>
<div>I am trying to use an Analysis Pass inside a transformation
pass. After the transformations, I call the analysis pass
again using getAvailableAnalysis but it seems to run on the
old IR.</div>
<div><br>
</div>
<div><b>Snippet of my code: </b></div>
<div>MyAnalysis* MP =
getAnalysisIfAvailable<MyAnalysis>();<br>
</div>
<div>... Transformation code ... </div>
<div>MyAnalysis* NewMP =
getAnalysisIfAvailable<MyAnalysis>();<br>
</div>
<div>... Transformation code ...</div>
<div><br>
</div>
<div>MP and NewMP are the same, while I have transformed the
code. Please let me know if there is something wrong with what
I am doing.</div>
</div>
</blockquote>
<br>
It looks like your transformation pass and the analysis pass you're
querying are the same type of pass (either they're both
FunctionPass'es or ModulePass'es). The PassManager isn't rerunning
the analysis pass because your pass is still running; it will not
decide on whether to rerun the analysis pass until your pass is
finished. As a result, the analysis pass's results reflect what it
computed *before* your pass ran and will not reflect any changes
that your transform pass has made.<br>
<br>
While there are a few exceptions, in the general case, a transform
pass cannot rely on an analysis pass to update itself to reflect
changes that the transform pass has made. The transform pass can
only see analysis results for what the code looked like before
transformation started.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAL6s+WnN5=X=KDUwwySW_3j2ULG5HaarrXbxnTM+xBCNc0xy4g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks!</div>
<div>Manish</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>