<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hi,</div>
<div> </div>
<div>Did anyone faced any issues with the recent changes made for AliasAnalysis.</div>
<div>AliasAnalysis interface changed to AAResultsWrapperPass.</div>
<div>Prior was able to use AliasAnalysis in module pass, now facing error while using AAResultsWrapperPass:</div>
<div> </div>
<div><i>ld: /home</i><i>/</i><i>ashutosh/I2D</i><i>Promo</i><i>/llvm/include/llvm/PassAnalysisSupport.h:230: AnalysisType& llvm::Pass::getAnalysisID(llvm::AnalysisID) const [with AnalysisType = llvm::AAResultsWrapperPass; llvm::AnalysisID = const void*]: Assertion
`ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed.</i></div>
<div><i>clang: error: unable to execute command: Aborted (core dumped)</i></div>
<div> </div>
<div>AAResultsWrapperPass is a FunctionPass. Is that the reason this can’t be used in ModulePass ?</div>
<div> </div>
<div>Looks like I’m missing something, can anyone help to get AliasAnalysis in ModulePass ?</div>
<div> </div>
<div>Usage:</div>
<div>class myclass: public ModulePass {</div>
<div>public:</div>
<div>void getAnalysisUsage(AnalysisUsage &AU) const override {</div>
<div> AU.addRequired<AAResultsWrapperPass>();</div>
<div> AU.setPreservesAll();</div>
<div> }</div>
<div>}</div>
<div>bool myclass::runOnModule(Module &M) {</div>
<div> AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();</div>
<div>}</div>
<div>INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)</div>
<div> </div>
<div>Regards,</div>
<div>Ashutosh</div>
<div> </div>
</span></font>
</body>
</html>