OSDN Git Service

[SLP] Pass in correct alignment when query memory access cost
authorGuozhi Wei <carrot@google.com>
Tue, 31 May 2016 20:41:19 +0000 (20:41 +0000)
committerGuozhi Wei <carrot@google.com>
Tue, 31 May 2016 20:41:19 +0000 (20:41 +0000)
commit12ab473e2bc2bb16c5da409b58d0d323bc3805bc
tree74399fb50760a6c392f4264ac9fc1f1395bf791e
parente9ddf3a4a753c755496ae88d458d6ccca1200579
[SLP] Pass in correct alignment when query memory access cost

This patch fixes bug https://llvm.org/bugs/show_bug.cgi?id=27897.

When query memory access cost, current SLP always passes in alignment value of 1 (unaligned), so it gets a very high cost of scalar memory access, and wrongly vectorize memory loads in the test case.

It can be fixed by simply giving correct alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271333 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/PowerPC/lit.local.cfg [new file with mode: 0644]
test/Transforms/SLPVectorizer/PowerPC/pr27897.ll [new file with mode: 0644]