[llvm] ff54d1c - Remove remaining callers of CreateShuffleVector with unsigned indices and mark it as deprecated
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 19 02:51:06 PDT 2020
Author: Benjamin Kramer
Date: 2020-04-19T11:48:28+02:00
New Revision: ff54d1c897849606a2eeb30873f705b3b53f3c5e
URL: https://github.com/llvm/llvm-project/commit/ff54d1c897849606a2eeb30873f705b3b53f3c5e
DIFF: https://github.com/llvm/llvm-project/commit/ff54d1c897849606a2eeb30873f705b3b53f3c5e.diff
LOG: Remove remaining callers of CreateShuffleVector with unsigned indices and mark it as deprecated
No functionality change intended.
Added:
Modified:
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index d4485ee23ab4..4f4f58a96163 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -2377,8 +2377,10 @@ class IRBuilderBase {
return CreateShuffleVector(V1, V2, IntMask, Name);
}
- Value *CreateShuffleVector(Value *V1, Value *V2, ArrayRef<uint32_t> Mask,
- const Twine &Name = "") {
+ LLVM_ATTRIBUTE_DEPRECATED(Value *CreateShuffleVector(Value *V1, Value *V2,
+ ArrayRef<uint32_t> Mask,
+ const Twine &Name = ""),
+ "Pass indices as 'int' instead") {
SmallVector<int, 16> IntMask;
IntMask.assign(Mask.begin(), Mask.end());
return CreateShuffleVector(V1, V2, IntMask, Name);
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 2c54386351e2..fabe3e06bfeb 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -4079,7 +4079,7 @@ Value *BoUpSLP::vectorizeTree(ArrayRef<Value *> VL) {
}
static void inversePermutation(ArrayRef<unsigned> Indices,
- SmallVectorImpl<unsigned> &Mask) {
+ SmallVectorImpl<int> &Mask) {
Mask.clear();
const unsigned E = Indices.size();
Mask.resize(E);
@@ -4161,7 +4161,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
case Instruction::ExtractElement: {
Value *V = E->getSingleOperand(0);
if (!E->ReorderIndices.empty()) {
- OrdersType Mask;
+ SmallVector<int, 4> Mask;
inversePermutation(E->ReorderIndices, Mask);
Builder.SetInsertPoint(VL0);
V = Builder.CreateShuffleVector(V, UndefValue::get(VecTy), Mask,
@@ -4186,7 +4186,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
LoadInst *V = Builder.CreateAlignedLoad(VecTy, Ptr, LI->getAlign());
Value *NewV = propagateMetadata(V, E->Scalars);
if (!E->ReorderIndices.empty()) {
- OrdersType Mask;
+ SmallVector<int, 4> Mask;
inversePermutation(E->ReorderIndices, Mask);
NewV = Builder.CreateShuffleVector(NewV, UndefValue::get(VecTy), Mask,
"reorder_shuffle");
@@ -4375,7 +4375,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
LI = Builder.CreateAlignedLoad(VecTy, VecPtr, Alignment);
Value *V = propagateMetadata(LI, E->Scalars);
if (IsReorder) {
- OrdersType Mask;
+ SmallVector<int, 4> Mask;
inversePermutation(E->ReorderIndices, Mask);
V = Builder.CreateShuffleVector(V, UndefValue::get(V->getType()),
Mask, "reorder_shuffle");
@@ -4400,10 +4400,10 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
Value *VecValue = vectorizeTree(E->getOperand(0));
if (IsReorder) {
- OrdersType Mask;
- inversePermutation(E->ReorderIndices, Mask);
+ SmallVector<int, 4> Mask(E->ReorderIndices.begin(),
+ E->ReorderIndices.end());
VecValue = Builder.CreateShuffleVector(
- VecValue, UndefValue::get(VecValue->getType()), E->ReorderIndices,
+ VecValue, UndefValue::get(VecValue->getType()), Mask,
"reorder_shuffle");
}
Value *ScalarPtr = SI->getPointerOperand();
More information about the llvm-commits
mailing list