OSDN Git Service

[SLP] Don't vectorize loads of non-packed types (like i1, i2).
authorMichael Zolotukhin <mzolotukhin@apple.com>
Wed, 30 Sep 2015 21:05:43 +0000 (21:05 +0000)
committerMichael Zolotukhin <mzolotukhin@apple.com>
Wed, 30 Sep 2015 21:05:43 +0000 (21:05 +0000)
commitad0be616bd40b56771212e118e053851b334862b
tree106962bad3b42d5cbb92b79f29a0b6fa3bf8e35f
parent892946c873cd8bd6c251543ed0670d0ee3ab3df0
[SLP] Don't vectorize loads of non-packed types (like i1, i2).

Summary:
Given an array of i2 elements, 4 consecutive scalar loads will be lowered to
i8-sized loads and thus will access 4 consecutive bytes in memory. If we
vectorize these loads into a single <4 x i2> load, it'll access only 1 byte in
memory. Hence, we should prohibit vectorization in such cases.

PS: Initial patch was proposed by Arnold.

Reviewers: aschwaighofer, nadav, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13277

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248943 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/bad_types.ll