<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 2015-04-21 à 18:36:38, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" class="">dberlin@dberlin.org</a>> a écrit :</div><div class=""><br class=""><blockquote type="cite" class="">I made it a FunctionPass instead of an ImmutablePass because<br class="">InitializeAliasAnalysis now needs a DataLayout argument, and I wasn’t sure<br class="">how to get that one from an ImmutablePass.<br class=""></blockquote><br class="">See CFLAliasAnalysis.cpp. You can get the datalayout from<br class="">doInitialization from the module.<br class=""></div></blockquote><div><br class=""></div>This is also what NoAA does, but given that it’s a bit special, I wasn’t sure if it was desirable.</div><div><br class=""></div><div>I returned to that, and with the RegisterPass change, this appears to work as expected, so problem solved?</div><div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" class=""><br class="">The first was to add the AA pass before calling `populateModulePassManager`,<br class="">since the AA passes are the first ones to be added, and this would put mine<br class="">first. This didn’t help: `runOnFunction` was called, but `alias` never was.<br class=""></blockquote><br class="">Okay, so without seeing what passes you are adding, i can't say why<br class="">alias was never called.<br class=""><br class="">You need to ensure you are adding the pass in the right order.<br class="">The first pass added to AA is the last pass queried (IE it's reverse order)<br class=""></div></blockquote></div><div class=""><br class=""></div>I figured that the last pass added has precedence a the comment that says that TBAA is added before Basic AA so that Basic AA wins in case of a disagreement, but since that it didn’t work, I tried the other way too.<div class=""><br class=""></div><div class="">For future reference, <a href="http://llvm.org/docs/doxygen/html/PassManagerBuilder_8cpp_source.html#l00136" class="">PassManagerBuilder creates the following AA passes</a>:</div><div class=""><br class=""></div><div class=""><div class=""><pre class="fragment" style="font-family: monospace, fixed; font-size: 9pt; border: 1px solid rgb(196, 207, 229); background-color: rgb(251, 252, 253); padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; line-height: 15px;"><span class="keywordflow" style="color: rgb(224, 128, 0);">if</span> (<a class="code" href="http://llvm.org/docs/doxygen/html/PassManagerBuilder_8cpp.html#a4e59132007f4c97b2a808df5fedf9584" style="color: rgb(70, 101, 162); text-decoration: none;">UseCFLAA</a>)
PM.<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1legacy_1_1PassManagerBase.html#a2ce2eacfa52640d3a2feb2d46d561b85" style="color: rgb(70, 101, 162); text-decoration: none;">add</a>(<a class="code" href="http://llvm.org/docs/doxygen/html/namespacellvm.html#aa497e235b2414fe9e942c308aa6edcb6" style="color: rgb(70, 101, 162); text-decoration: none;">createCFLAliasAnalysisPass</a>());
PM.<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1legacy_1_1PassManagerBase.html#a2ce2eacfa52640d3a2feb2d46d561b85" style="color: rgb(70, 101, 162); text-decoration: none;">add</a>(<a class="code" href="http://llvm.org/docs/doxygen/html/namespacellvm.html#a022323238327ae5edae5d42398e0325f" style="color: rgb(70, 101, 162); text-decoration: none;">createTypeBasedAliasAnalysisPass</a>());
PM.<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1legacy_1_1PassManagerBase.html#a2ce2eacfa52640d3a2feb2d46d561b85" style="color: rgb(70, 101, 162); text-decoration: none;">add</a>(<a class="code" href="http://llvm.org/docs/doxygen/html/namespacellvm.html#ad81266aaa6ff7606ad771dc5e451592b" style="color: rgb(70, 101, 162); text-decoration: none;">createScopedNoAliasAAPass</a>());
PM.<a class="code" href="http://llvm.org/docs/doxygen/html/classllvm_1_1legacy_1_1PassManagerBase.html#a2ce2eacfa52640d3a2feb2d46d561b85" style="color: rgb(70, 101, 162); text-decoration: none;">add</a>(<a class="code" href="http://llvm.org/docs/doxygen/html/namespacellvm.html#ab81115c38e816dea4cb563ca24faed96" style="color: rgb(70, 101, 162); text-decoration: none;">createBasicAliasAnalysisPass</a>());</pre><div class=""><br class=""></div><div class="">Thanks for your help.</div></div></div><div class=""><br class=""></div><div class="">Félix</div></body></html>