[LLVMdev] which LLVM transforms can optimize this code?

Umesh Kalappa umesh.kalappa0 at gmail.com
Mon Aug 13 00:34:26 PDT 2012


Hi Jun ,

Guess , the switch  -dse  will do the magic through opt and  to know the
analysis list ,use opt as shown below

opt   -debug-pass=Structure file.ll


Thanks
~Umesh Kalappa



On Sat, Aug 11, 2012 at 7:36 PM, NAKAMURA Takumi <geek4civic at gmail.com>wrote:

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


More information about the llvm-dev mailing list