Re: [eigen] Re: Strong inlining is sometimes ignored...

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


It is easily explained.

When SSE is disabled,

Redux.h line 92: ei_redux_novec_unroller<...>::run(...)

is called. This implementation simply unrolls with the functor.

In case SSE is enabled,

Redux.h line 299: ei_redux_novec_unroller<..., LinearVectorization, CompleteUnrolling>::run(...)

is called. This code contains an if-clause for the case when 'VectorizationSize' is not equal to 'Size' which calls the functor for the remaining vector entries. In case, we have even sized vectors, this code is compiled with zero length.

The easiest way to get really rid of this if-clause is to write another specialized functor for this case - this is possible since it can be computed at compile time if the _expression_ is fully vectorizable or not. Specializing the whole ei_redux_impl might be a bit painful since it would require to add an additional boolean flag - for all cases.

I just created a patch with all fixes...

On Thu, Oct 15, 2009 at 3:12 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
Second, I'd like to understand, why is this in
ei_redux_novec_unroller, while precisely you found that the issue
happened with vectorizable cases, so why not in ei_redux_vec_unroller
?

No idea... I have to take a look at that. It seems that when EIGEN_DONT_VECTORIZE is enabled LinearVectorization is never used. So _novec_ still allows linear vectorization. I have to double check the code.

- Hauke

Attachment: inlining.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/