<div dir="ltr">Hello,<div><br></div><div>I am performing alias analysis toward the following simple code:</div><div><br>struct MyStruct {<br>   int * f1;<br>     int * f2;<br>};</div><div><br>void NOALIAS(void* p, void* q){<br>}<br></div><div><br>int main() {<br>       struct MyStruct s[2];<br> int a,b;<br>      s[0].f1 = &a;<br>     s[1].f1 = &b;<br><br></div><div>NOALIAS(s[a].f1, s[b].f2);</div><div><br> return 0;<br>}<br></div><div><br></div><div>When I use the following command to generate .bc code and conduct alias analysis:</div><div><br></div><div>clang -c -emit-llvm t.c -O2<br></div><div>opt -basicaa -aa-eval -print-alias-sets -disable-output t.bc<br></div><div><br></div><div>I got the following outputs:</div><div><br></div><div>Alias sets for function 'NOALIAS':<br>Alias Set Tracker: 0 alias sets for 0 pointer values.<br></div><div><br></div><div>Alias sets for function 'main':<br>Alias Set Tracker: 0 alias sets for 0 pointer values.<br><br>===== Alias Analysis Evaluator Report =====<br>  1 Total Alias Queries Performed<br>  0 no alias responses (0.0%)<br>  <font color="#ff0000">1 may alias responses (100.0%)</font><br>  0 partial alias responses (0.0%)<br>  0 must alias responses (0.0%)<br></div><div><br></div><div>I checked the generated .ll code, and it shows that within the main function and NOALIAS functions, there is only a "ret" statement, with no global or local variables used. Could anyone shed some lights on where the "1 may alias" come from?  And is there a way that I can force the alias analysis algorithm to focus only the "main" function? Thank you very much.</div><div><br></div><div>Best,</div><div>Shuai</div></div>