<div dir="ltr"><br><div>Hello,</div><div><br></div><div>I am working on finding good optimization sequences for a given program (phase ordering problem). I have the following setup.</div><div><br></div><div>1) The source programs are translated into LLVM IR using -O0 + -scalarrepl.</div>
<div>2) Find an optimization sequence using some strategy which translates the IR generated in the</div><div> previous step into another IR.</div><div>3) Apply llc -O2 and map the IR in to target assembly code.</div><div>
<br></div><div>Using the above setup I found that the sequence [-functionattrs, -loop-rotate, -licm, -basicaa] reduces the runtime of the program from 3.1 seconds (when compiled using -O2) down to 0.1 seconds. Removing any of the optimizations in the sequence including the analysis phase -basicaa increases the runtime back to 3.1 seconds or above. When I was explaining this strange behaviour in the HiPEAC conference some one asked me how can dropping an analysis phase will have an impact on the program runtime. Can some one explain what is happening here?</div>
<div><br></div><div>The program is office_stringsearch1 from the MiBench suite.</div><div><br></div><div>On the same lines the way we hit upon the sequence [-functionattrs, -loop-rotate, -licm, -basicaa] is by applying a sequence reduction algorithm wherein we take a long sequence (which we hit using genetic or random search algorithm) and keep dropping the optimizations until the program runtime doesn't go up. So again the same question, why is that dropping -basicaa increases the program runtime?</div>
<div><br></div><div>-Suresh Purini</div></div>