[PATCH] Loop Vectorizer: Handle pointer stores/loads in getWidestType()
Nadav Rotem
nrotem at apple.com
Sun Feb 3 20:56:28 PST 2013
Hi Arnold,
The code LGTM, I have a comment about the test case:
>> +;RUN: opt -loop-vectorize -mcpu=core-i7-avx -debug -S < %s 2>&1 | FileCheck %s
The triple is incorrect. It should be "corei7-avx". Second, this test is target dependent and should be inside the X86 directory.
Thanks,
Nadav
On Feb 3, 2013, at 8:45 PM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> In the loop vectorizer cost model, we used to ignore stores/loads of a pointer
> type when computing the widest type within a loop. This meant that if we had
> only stores/loads of pointers in a loop we would return a widest type of 8bits
> (instead of 32 or 64 bit) and therefore a vector factor that was too big.
>
> Now, if we see a consecutive store/load of pointers we use the size of a pointer
> (from data layout).
>
> This problem occured in SingleSource/Benchmarks/Shootout-C++/hash.cpp (reduced
> test case is the first test in ptr_store_cost.ll).
>
> <0001-Loop-Vectorizer-Handle-pointer-stores-loads-in-getWi.patch>
More information about the llvm-commits
mailing list