<div dir="ltr">Hello everyone, <div><br></div><div>I want to decide whether a function is executed or not. For example (the value of</div><div>cond is not determined at compile time):</div><div><br></div><div>br i1 %cond, label %if, label %else</div>
<div><br></div><div>if:</div><div>  ...</div><div>  call void f()</div><div>  ...</div><div>  br label %exit</div><div><br></div><div>else:</div><div>  ...</div><div>  br label %exit<br></div><div><br></div><div>We could say that function f is control dependent on cond and may not be </div>
<div>executed.</div><div><br></div><div>On the other hand:</div><div><br></div><div><div>br i1 %cond, label %if, label %else</div><div><br></div><div>if:</div><div>  ...</div><div>  call void f()</div><div>  ...</div><div>
  br label %exit</div><div><br></div><div>else:</div><div>  ...</div><div>  call void f()</div><div>  ...</div><div>  br label %exit</div></div><div><br></div><div>No matter the value of cond is, function f would be executed.<br>
</div><div><br></div><div>I am wondering whether there exist any algorithm to decide whether function f is </div><div>executed or not. Any suggestion or key word are appreciated.</div><div><br></div><div>Many thanks</div>
</div>