Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto vectorization in llvm

Tags:

llvm

clang

I am trying to create auto-vectorized code with clang-3.2

From the slides here - http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf

I should be able to generate vectorized code with this command line.

bin/clang++ -c -O3 -mllvm -vectorize -bb-vectorize-aligned-only clang-auto-vec.cpp

But it throws an error error: unsupported option '-b b-vectorize-aligned-only'

If i remove just the -bb-vectorize-aligned-only, it doesn't create any vectorized code.

whats going wrong here?

like image 555
excray Avatar asked Jun 20 '12 22:06

excray


People also ask

What is SLP vectorization?

The SLP Vectorizer The goal of SLP vectorization (a.k.a. superword-level parallelism) is to combine similar independent instructions into vector instructions. Memory accesses, arithmetic operations, comparison operations, PHI-nodes, can all be vectorized using this technique.

What is vectorization in compiler?

A vectorizing compiler transforms such loops into sequences of vector operations. These vector operations perform additions on blocks of elements from the arrays a , b and c . Automatic vectorization is a major research topic in computer science.

What is vectorization and why is it used?

Vectorization is the process of converting an algorithm from operating on a single value at a time to operating on a set of values (vector) at one time. Modern CPUs provide direct support for vector operations where a single instruction is applied to multiple data (SIMD).

What is vectorization CPP?

Vectorization is the use of vector instructions to speed up program execution. Vectorization can be done both by programmers by explicitly writing vector instructions and by a compiler. The latter case is called Auto Vectorization .


1 Answers

Prepend -mllvm to every flag. E.g. -mllvm -vectorize -mllvm -bb-vectorize-aligned-only

like image 175
Anton Korobeynikov Avatar answered Sep 20 '22 18:09

Anton Korobeynikov