[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass

Tobias Grosser tobias at grosser.es
Thu Nov 10 13:26:39 PST 2011


On 11/10/2011 10:25 PM, Hal Finkel wrote:
> On Tue, 2011-11-08 at 20:24 +0100, Tobias Grosser wrote:
>> On 11/08/2011 03:36 PM, Hal Finkel wrote:
>>> On Tue, 2011-11-08 at 12:12 +0100, Tobias Grosser wrote:
>>>> On 11/08/2011 11:45 AM, Hal Finkel wrote:
>>>>> I've attached the latest version of my autovectorization patch.
>>>>>
>>>>> Working through the test suite has proved to be a productive
>>>>> experience ;) -- And almost all of the bugs that it revealed have now
>>>>> been fixed. There are still two programs that don't compile with
>>>>> vectorization turned on, and I'm working on those now, but in case
>>>>> anyone feels like playing with vectorization, this patch will probably
>>>>> work for you.
>>>>
>>>> Hey Hal,
>>>>
>>>> those are great news. Especially as the numbers seem to show that
>>>> vectorization has a significant performance impact. What did you compare
>>>> exactly. 'clang -O3' against 'clang -O3 -mllvm -vectorize'?
>>>
>>> Yes. [I've tested the current patch directly using opt -vectorize
>>> -unroll-allow-partial; for running the test suite I recompiled
>>> llvm/clang to hardcode the options as I wanted them].
>>
>> You should not need to hack clang. As shown above, you should be able to
>> pass '-vectorize' to the optimizer by using '-mllvm -vectorize' in your
>> CFLAGS.
>
> -mllvm -unroll-allow-partial works because -unroll-allow-partial is an
> option to the pass, but I had added -vectorize as an option to opt
> itself, and those options do not get picked up by clang. Would it be
> better to add -vectorize as an option in IPO/PassManagerBuilder? Maybe
> I'll try doing it that way instead.

Yes, that's probably better.

Cheers
Tobi



More information about the llvm-dev mailing list