From: NAKAMURA Takumi Date: Tue, 15 Dec 2015 09:37:31 +0000 (+0000) Subject: InstCombineLoadStoreAlloca.cpp: Avoid instantiating Twine. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=35a68db8ba0edd48d4db545388702f6fa64cc9b6;p=oota-llvm.git InstCombineLoadStoreAlloca.cpp: Avoid instantiating Twine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255637 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 79644994394..12566922c83 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "InstCombineInternal.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/Loads.h" #include "llvm/IR/DataLayout.h" @@ -540,8 +541,10 @@ static Instruction *unpackLoadToAggregate(InstCombiner &IC, LoadInst &LI) { return nullptr; auto Name = LI.getName(); - auto LoadName = LI.getName() + ".unpack"; - auto EltName = Name + ".elt"; + SmallString<16> LoadName = Name; + LoadName += ".unpack"; + SmallString<16> EltName = Name; + EltName += ".elt"; auto *Addr = LI.getPointerOperand(); Value *V = UndefValue::get(T); auto *IdxType = Type::getInt32Ty(ST->getContext()); @@ -944,9 +947,11 @@ static bool unpackStoreToAggregate(InstCombiner &IC, StoreInst &SI) { if (SL->hasPadding()) return false; - auto EltName = V->getName() + ".elt"; + SmallString<16> EltName = V->getName(); + EltName += ".elt"; auto *Addr = SI.getPointerOperand(); - auto AddrName = Addr->getName() + ".repack"; + SmallString<16> AddrName = Addr->getName(); + AddrName += ".repack"; auto *IdxType = Type::getInt32Ty(ST->getContext()); auto *Zero = ConstantInt::get(IdxType, 0); for (unsigned i = 0; i < Count; i++) {