Hi Eric, On Oct 5, 2012, at 11:29 AM, Eric Christopher <echristo at gmail.com> wrote:>> 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.TargetData does not have enough information for vectorization. For example, we need to ask the target if it has efficient "cos4" implementation or the cost of 'mult_4xf32'. We need lots of target specific information for deciding when to vectorize and which vectorization optimizations to apply.> >> >> 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?If we want TLI in opt then we need to link it with the codegen. This makes OPT almost identical to LLC. IT will link with the same libraries and just differ in the command line arguments.> >> 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.TargetData is useful, but not enough for vectorization.> > -eric
Nadav,>> Possibly, though I think TargetData should still be able to get you >> what you want. > > > TargetData does not have enough information for vectorization. For example, we need to ask the target if it has efficient "cos4" implementation or the cost of 'mult_4xf32'. We need lots of target specific information for deciding when to vectorize and which vectorization optimizations to apply. >Sure. I was mostly going with the idea of "insert some Targetish structure here".>> TargetData is pretty useful during opt if it's available, probably no >> need to merge >> the tools though. > > TargetData is useful, but not enough for vectorization.I think an interface should be designed on top of the current sets of data that will encompass what we may want at the target level and we can make our decisions based on that. Specific names or making "X class available to Y passes at Z level" can probably wait. -eric
On Oct 5, 2012, at 1:14 PM, Eric Christopher <echristo at gmail.com> wrote:> Nadav, > >>> Possibly, though I think TargetData should still be able to get you >>> what you want. >> >> >> TargetData does not have enough information for vectorization. For example, we need to ask the target if it has efficient "cos4" implementation or the cost of 'mult_4xf32'. We need lots of target specific information for deciding when to vectorize and which vectorization optimizations to apply. >> > > Sure. I was mostly going with the idea of "insert some Targetish > structure here". > >>> TargetData is pretty useful during opt if it's available, probably no >>> need to merge >>> the tools though. >> >> TargetData is useful, but not enough for vectorization. > > I think an interface should be designed on top of the current sets of > data that will encompass what we may want at the target level and we > can make our decisions based on that.Yes. I plan to start working on this new interface (TargetVectorData ?) as soon as we merge the tools.> Specific names or making "X > class available to Y passes at Z level" can probably wait. >yep.> -ericThanks :)