[llvm] 66b9f5f - [GVNSink] Simplify code. NFC.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 1 04:13:12 PDT 2020
Author: Benjamin Kramer
Date: 2020-04-01T13:13:00+02:00
New Revision: 66b9f5f7f0d26d789f74ddc8a99d0e446d17a22c
URL: https://github.com/llvm/llvm-project/commit/66b9f5f7f0d26d789f74ddc8a99d0e446d17a22c
DIFF: https://github.com/llvm/llvm-project/commit/66b9f5f7f0d26d789f74ddc8a99d0e446d17a22c.diff
LOG: [GVNSink] Simplify code. NFC.
Added:
Modified:
llvm/lib/Transforms/Scalar/GVNSink.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/GVNSink.cpp b/llvm/lib/Transforms/Scalar/GVNSink.cpp
index df1d97877c59..5fee60fc6bf9 100644
--- a/llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -360,12 +360,8 @@ class InstructionUseExpr : public GVNExpression::BasicExpression {
setOpcode(I->getOpcode());
setType(I->getType());
- if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I)) {
- ArrayRef<int> OrigMask = SVI->getShuffleMask();
- int *Mask = A.Allocate<int>(OrigMask.size());
- llvm::copy(OrigMask, Mask);
- ShuffleMask = ArrayRef<int>(Mask, OrigMask.size());
- }
+ if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I))
+ ShuffleMask = SVI->getShuffleMask().copy(A);
for (auto &U : I->uses())
op_push_back(U.getUser());
More information about the llvm-commits
mailing list