<div>Hi Jun ,</div><div><div><br></div><div>Guess , the switch  -dse  will do the magic through opt and  to know the analysis list ,use opt as shown below</div><div><br></div><div>opt   -debug-pass=Structure file.ll</div><div>
  </div></div><div><br></div><div>Thanks </div><div>~Umesh Kalappa</div>
<div><br></div><br><div><h3 style="background-image:url('http://llvm.org/docs/_static/lines.gif');font-family:'Georgia,Palatino,Times,Roman,SanSerif';border-width:1px;border-style:solid none;vertical-align:middle;padding:4pt;width:905.2666625976563px;font-size:12pt;margin:1.5em 0.5em 0.5em">

<br></h3><div class="gmail_quote">On Sat, Aug 11, 2012 at 7:36 PM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

In principle, transform passes are not responsible to inspect @yyy is<br>
not aliased to @XXX.<br>
<br>
I guess "opt -basicaa -{any-transform-passes}" would help you.<br>
You may also try "opt -{any-analysis-passes} -aa-eval}"<br>
<br>
Note, opt is the tool not for users but for developers. He does not<br>
invoke unspecified passes automatically.<br>
<br>
...Takumi<br>
<br>
2012/8/11 Jun Koi <<a href="mailto:junkoi2004@gmail.com" target="_blank">junkoi2004@gmail.com</a>>:<br>
<div><div>> On Sat, Aug 11, 2012 at 7:42 PM, Jun Koi <<a href="mailto:junkoi2004@gmail.com" target="_blank">junkoi2004@gmail.com</a>> wrote:<br>
>> hi,<br>
>><br>
>> i am trying to optimize the below code, in one of my LLVM functions:<br>
>><br>
>> ....<br>
>>   store i32 96, i32* @XXX, align 4     ; (1)<br>
>>   store i32 117, i32* @yyy, align 4    ; (2)<br>
>>   store i32 31, i32* @XXX, align 4     ; (3)<br>
>> ....<br>
>><br>
>> naturally, optimize passes should remove the line (1), because later<br>
>> line (3) overwrites the value of the same global variable XXX.<br>
>> i run this code via "opt" with option "-O3", and indeed line (1) was removed.<br>
>><br>
>> but i want to do that in my code, without having to call "opt".<br>
>> however, after trying a lot of transforms (at FunctionPassManager<br>
>> level), line (1) is still there.<br>
>><br>
>> so i am wondering which passes (in the list<br>
>> <a href="http://llvm.org/docs/Passes.html#transforms" target="_blank">http://llvm.org/docs/Passes.html#transforms</a>) can remove line (1)<br>
>> above?<br>
><br>
> i have some doubts here:<br>
><br>
> - i only tried to optimize code with transforms (see the list<br>
> <a href="http://llvm.org/docs/Passes.html#transforms" target="_blank">http://llvm.org/docs/Passes.html#transforms</a>). do i need to combine<br>
> that with analysis passes (<a href="http://llvm.org/docs/Passes.html#analyses" target="_blank">http://llvm.org/docs/Passes.html#analyses</a>),<br>
> or only transforms will do? if combination is necessary, how to<br>
> combine?<br>
><br>
> - i guess another reason that line (1) was not removed because i run<br>
> the tranforms only once. do i need to run transforms in many rounds,<br>
> and in different order to have better optimized code?<br>
><br>
> many thanks,<br>
> Jun<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>