[PATCH] D110146: [IR] Add the constructor of ShuffleVector for one-input-vector.
Hyeongyu Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 21 06:06:17 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG043733d67731: [IR] Add the constructor of ShuffleVector for one-input-vector. (authored by hyeongyukim).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110146/new/
https://reviews.llvm.org/D110146
Files:
llvm/include/llvm/IR/Instructions.h
llvm/lib/IR/Instructions.cpp
Index: llvm/lib/IR/Instructions.cpp
===================================================================
--- llvm/lib/IR/Instructions.cpp
+++ llvm/lib/IR/Instructions.cpp
@@ -1907,6 +1907,32 @@
// ShuffleVectorInst Implementation
//===----------------------------------------------------------------------===//
+static Value *createPlaceholderForShuffleVector(Value *V) {
+ assert(V && "Cannot create placeholder of nullptr V");
+ return PoisonValue::get(V->getType());
+}
+
+ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *Mask, const Twine &Name,
+ Instruction *InsertBefore)
+ : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name,
+ InsertBefore) {}
+
+ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *Mask, const Twine &Name,
+ BasicBlock *InsertAtEnd)
+ : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name,
+ InsertAtEnd) {}
+
+ShuffleVectorInst::ShuffleVectorInst(Value *V1, ArrayRef<int> Mask,
+ const Twine &Name,
+ Instruction *InsertBefore)
+ : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name,
+ InsertBefore) {}
+
+ShuffleVectorInst::ShuffleVectorInst(Value *V1, ArrayRef<int> Mask,
+ const Twine &Name, BasicBlock *InsertAtEnd)
+ : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name,
+ InsertAtEnd) {}
+
ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const Twine &Name,
Instruction *InsertBefore)
Index: llvm/include/llvm/IR/Instructions.h
===================================================================
--- llvm/include/llvm/IR/Instructions.h
+++ llvm/include/llvm/IR/Instructions.h
@@ -2017,6 +2017,14 @@
ShuffleVectorInst *cloneImpl() const;
public:
+ ShuffleVectorInst(Value *V1, Value *Mask, const Twine &NameStr = "",
+ Instruction *InsertBefore = nullptr);
+ ShuffleVectorInst(Value *V1, Value *Mask, const Twine &NameStr,
+ BasicBlock *InsertAtEnd);
+ ShuffleVectorInst(Value *V1, ArrayRef<int> Mask, const Twine &NameStr = "",
+ Instruction *InsertBefore = nullptr);
+ ShuffleVectorInst(Value *V1, ArrayRef<int> Mask, const Twine &NameStr,
+ BasicBlock *InsertAtEnd);
ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const Twine &NameStr = "",
Instruction *InsertBefor = nullptr);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110146.373885.patch
Type: text/x-patch
Size: 2754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210921/0d8b769b/attachment.bin>
More information about the llvm-commits
mailing list