From d10a84f86e045ffe6eb52ee46b6d17261dbed3a3 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 1 Apr 2020 13:12:46 +0200 Subject: [PATCH] [GVNSink] Simplify code. NFC. --- lib/Transforms/Scalar/GVNSink.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Transforms/Scalar/GVNSink.cpp b/lib/Transforms/Scalar/GVNSink.cpp index df1d97877c5..5fee60fc6bf 100644 --- a/lib/Transforms/Scalar/GVNSink.cpp +++ b/lib/Transforms/Scalar/GVNSink.cpp @@ -360,12 +360,8 @@ public: setOpcode(I->getOpcode()); setType(I->getType()); - if (ShuffleVectorInst *SVI = dyn_cast(I)) { - ArrayRef OrigMask = SVI->getShuffleMask(); - int *Mask = A.Allocate(OrigMask.size()); - llvm::copy(OrigMask, Mask); - ShuffleMask = ArrayRef(Mask, OrigMask.size()); - } + if (ShuffleVectorInst *SVI = dyn_cast(I)) + ShuffleMask = SVI->getShuffleMask().copy(A); for (auto &U : I->uses()) op_push_back(U.getUser());