diff options
author | Juneyoung Lee <aqjune@gmail.com> | 2020-12-30 07:28:17 +0900 |
---|---|---|
committer | Juneyoung Lee <aqjune@gmail.com> | 2020-12-30 22:36:08 +0900 |
commit | 9b29610228c838a66a88edf43ddd25acf8d1b477 (patch) | |
tree | 96957ab446c808c9fd07ac66d17e179f14324d2b /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | e47e313d647e00ab5fbb4a17f9b69f33c49aafc3 (diff) | |
download | llvm-9b29610228c838a66a88edf43ddd25acf8d1b477.zip llvm-9b29610228c838a66a88edf43ddd25acf8d1b477.tar.gz llvm-9b29610228c838a66a88edf43ddd25acf8d1b477.tar.bz2 |
Use unary CreateShuffleVector if possible
As mentioned in D93793, there are quite a few places where unary `IRBuilder::CreateShuffleVector(X, Mask)` can be used
instead of `IRBuilder::CreateShuffleVector(X, Undef, Mask)`.
Let's update them.
Actually, it would have been more natural if the patches were made in this order:
(1) let them use unary CreateShuffleVector first
(2) update IRBuilder::CreateShuffleVector to use poison as a placeholder value (D93793)
The order is swapped, but in terms of correctness it is still fine.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D93923
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 653680e..80ae6b3 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -958,8 +958,7 @@ llvm::getShuffleReduction(IRBuilderBase &Builder, Value *Src, unsigned Op, // Fill the rest of the mask with undef. std::fill(&ShuffleMask[i / 2], ShuffleMask.end(), -1); - Value *Shuf = Builder.CreateShuffleVector( - TmpVec, UndefValue::get(TmpVec->getType()), ShuffleMask, "rdx.shuf"); + Value *Shuf = Builder.CreateShuffleVector(TmpVec, ShuffleMask, "rdx.shuf"); if (Op != Instruction::ICmp && Op != Instruction::FCmp) { // The builder propagates its fast-math-flags setting. |