[LLVMdev] Modifying LoopUnrollingPass
Renato Golin
renato.golin at linaro.org
Tue May 5 11:31:19 PDT 2015
Hi Yaduveer,
I may be missing something, but it seems you're trying to get
different cores running parts of the loop, which you'll get for free
if you use OpenMP.
The loop unroller is meant to increase load/store speed by loading a
lot of values, then operating on all of them, then writing back
altogether. Even if not vectorized (SIMD, not threads), it still has
some performance gains. Vectorization is also only about SIMD engines
in a single core (doing 2/4/8 operations at the same time), nothing to
do with using multiple cores.
Before you jump head first into the source, you need to ask yourself
the right question: What do you want to do?
1) Use all cores, dividing the loop into multiple cores, one block at
a time. Use OpenMP for this.
2) Use your SIMD engine on each core. Use the loop vectorizer for this.
3) Or is it just about load/store speed ups? The loop unroller will
help you here.
You can also use all three at the same time, having all cores running
their SIMD engines with a massively unrolled loop by using all of the
above.
cheers,
--renato
On 2 May 2015 at 17:00, yaduveer singh <yaduveer99 at gmail.com> wrote:
> Hi Zhoulai,
>
> I am trying to modify "LoopUnrollPass" in llvm which produces multiple
> copies of loop equal to the loop unroll factor.Currently, using multicore
> architecture, say 3 for example and the execution goes like:
>
> for 3 cores if there are 9 iterations of loop
> core instruction
> 1 0,3,6
> 2 1,4,7
> 3 2,5,8
>
> But I want to to modify such that it can execute in following way:
>
> core instruction
> 1 0,1,2
> 2 3,4,5
> 3 6,7,8
>
> I am not able to get where to modify for this. I tried creating a sample
> pass using original LoopUnrollPass code and run "make", I received
> following error:
>
> loopunrollp.cpp:210:1: error: ‘void
> llvm::initializeLoopUnrollpPass(llvm::PassRegistry&)’ should have been
> declared inside ‘llvm’
> /bin/rm: cannot remove
> `/home/yaduveer/RP/LLVM/llvm/lib/Transforms/loopunrollp/Debug+Asserts/loopunrollp.d.tmp':
> No such file or directory
>
>
> Please help
>
> Thanks,
> Yaduveer
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list