[LLVMdev] LLVM Loop Vectorizer

Hal Finkel hfinkel at anl.gov
Fri Oct 5 11:43:48 PDT 2012

----- Original Message -----
> From: "Eric Christopher" <echristo at gmail.com>
> To: "Nadav Rotem" <nrotem at apple.com>
> Cc: "llvmdev at cs.uiuc.edu Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Friday, October 5, 2012 1:29:50 PM
> Subject: Re: [LLVMdev] LLVM Loop Vectorizer
> > Regarding TLI.  So, DAGCombine, CodeGenPrepare, LoopReduce all use
> > the TLI
> > interface which can answer questions such as "is this operation
> > supported ?"
> > or "is this type legal".   This is a subset of what we need in a
> > vectorized.
> > We can discuss other requirements that the vectorizer may have
> > after we
> > finish with the first phase.  I suspect that we may have to
> > refactor some
> > functionality out of TLI.
> >
> Possibly, though I think TargetData should still be able to get you
> what you want.

I think this is the wrong way to look at the problem. The real question is: why should we keep OPT and LLC separate? Keeping them separate and using some extension of TargetData will just mean manually duplicating information in this extended TargetData that we otherwise have in the backends. This is error-prone [from personal experience] and otherwise unproductive.

In addition, merging the tools will allow the consolidation of target-specific code in OPT. There is code in InstCombine, for example, that specifically deals with x86 intrinsics. This code should be moved into a callback provided by the x86 target. Currently, however, this is not possible because of this separation.


> >
> > Currently TLI is only available in LLC. I suggest that we merge LLC
> > and OPT
> > into a single tool that will drive both IR-level passes and the
> > codegen.
> >
> *shrug* I really don't think this is necessary either. There's really
> no need for
> merging the two tools (and IMO would weaken the separation here). Why
> not just have TargetData/TargetLoweringInfo in opt?
> > I agree that it is not necessary for many optimizations.  However,
> > this is
> > absolutely needed for lower-level transformations such as strength
> > reduction.  So, I plan to keep the current behavior that OPT has
> > where if a
> > target information is not provided through the command line then
> > TargetData
> > is kept uninitialized (null pointer). So, as far as IR-level passes
> > go,
> > nothing is going to change.
> >
> TargetData is pretty useful during opt if it's available, probably no
> need to merge
> the tools though.
> -eric
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory

More information about the llvm-dev mailing list