<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In <span style="font-family: Menlo; font-size: 14px;" class="">274582.</span><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class="">Manman</span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class=""><br class=""></span></font><div style=""><blockquote type="cite" class=""><div class="">On Jul 5, 2016, at 3:25 PM, Manman Ren <<a href="mailto:mren@apple.com" class="">mren@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Jul 2, 2016, at 4:41 AM, Benjamin Kramer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: d0k<br class="">Date: Sat Jul 2 06:41:39 2016<br class="">New Revision: 274431<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=274431&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=274431&view=rev</a><br class="">Log:<br class="">Use arrays or initializer lists to feed ArrayRefs instead of SmallVector where possible.<br class=""><br class="">No functionality change intended.<br class=""><br class="">Modified:<br class=""> llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br class=""> llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp<br class=""> llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp<br class=""> llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h<br class=""> llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp<br class=""> llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp<br class=""> llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp<br class=""> llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp<br class=""> llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br class=""><br class="">Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)<br class="">+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -3022,9 +3022,7 @@ ScalarEvolution::getGEPExpr(Type *Pointe<br class=""><br class="">const SCEV *ScalarEvolution::getSMaxExpr(const SCEV *LHS,<br class=""> const SCEV *RHS) {<br class="">- SmallVector<const SCEV *, 2> Ops;<br class="">- Ops.push_back(LHS);<br class="">- Ops.push_back(RHS);<br class="">+ SmallVector<const SCEV *, 2> Ops = {LHS, RHS};<br class=""> return getSMaxExpr(Ops);<br class="">}<br class=""><br class="">@@ -3125,9 +3123,7 @@ ScalarEvolution::getSMaxExpr(SmallVector<br class=""><br class="">const SCEV *ScalarEvolution::getUMaxExpr(const SCEV *LHS,<br class=""> const SCEV *RHS) {<br class="">- SmallVector<const SCEV *, 2> Ops;<br class="">- Ops.push_back(LHS);<br class="">- Ops.push_back(RHS);<br class="">+ SmallVector<const SCEV *, 2> Ops = {LHS, RHS};<br class=""> return getUMaxExpr(Ops);<br class="">}<br class=""><br class=""><br class="">Modified: llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp (original)<br class="">+++ llvm/trunk/lib/Target/AArch64/AArch64CollectLOH.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -628,10 +628,7 @@ static void computeADRP(const InstrToIns<br class=""> continue;<br class=""> }<br class=""> DEBUG(dbgs() << "Record AdrpAdrp:\n" << *L2 << '\n' << *L1 << '\n');<br class="">- SmallVector<const MachineInstr *, 2> Args;<br class="">- Args.push_back(L2);<br class="">- Args.push_back(L1);<br class="">- AArch64FI.addLOHDirective(MCLOH_AdrpAdrp, Args);<br class="">+ AArch64FI.addLOHDirective(MCLOH_AdrpAdrp, {L1, L2});<br class=""></blockquote><br class="">Did you swap the order of L2 and L1 here?<br class=""><br class="">Manman<br class=""><blockquote type="cite" class=""> ++NumADRPSimpleCandidate;<br class=""> }<br class="">#ifdef DEBUG<br class="">@@ -765,13 +762,9 @@ static bool registerADRCandidate(const M<br class=""> "ADD already involved in LOH.");<br class=""> DEBUG(dbgs() << "Record AdrpAdd\n" << Def << '\n' << Use << '\n');<br class=""><br class="">- SmallVector<const MachineInstr *, 2> Args;<br class="">- Args.push_back(&Def);<br class="">- Args.push_back(&Use);<br class="">-<br class="">- AArch64FI.addLOHDirective(Use.getOpcode() == AArch64::ADDXri ? MCLOH_AdrpAdd<br class="">- : MCLOH_AdrpLdrGot,<br class="">- Args);<br class="">+ AArch64FI.addLOHDirective(<br class="">+ Use.getOpcode() == AArch64::ADDXri ? MCLOH_AdrpAdd : MCLOH_AdrpLdrGot,<br class="">+ {&Def, &Use});<br class=""> return true;<br class="">}<br class=""><br class=""><br class="">Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)<br class="">+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -3535,11 +3535,8 @@ SDValue AArch64TargetLowering::LowerELFT<br class=""> SDValue Chain = DAG.getEntryNode();<br class=""> SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);<br class=""><br class="">- SmallVector<SDValue, 2> Ops;<br class="">- Ops.push_back(Chain);<br class="">- Ops.push_back(SymAddr);<br class="">-<br class="">- Chain = DAG.getNode(AArch64ISD::TLSDESC_CALLSEQ, DL, NodeTys, Ops);<br class="">+ Chain =<br class="">+ DAG.getNode(AArch64ISD::TLSDESC_CALLSEQ, DL, NodeTys, {Chain, SymAddr});<br class=""> SDValue Glue = Chain.getValue(1);<br class=""><br class=""> return DAG.getCopyFromReg(Chain, DL, AArch64::X0, PtrVT, Glue);<br class="">@@ -8931,9 +8928,10 @@ static SDValue performPostLD1Combine(SDN<br class=""> LoadSDN->getMemOperand());<br class=""><br class=""> // Update the uses.<br class="">- SmallVector<SDValue, 2> NewResults;<br class="">- NewResults.push_back(SDValue(LD, 0)); // The result of load<br class="">- NewResults.push_back(SDValue(UpdN.getNode(), 2)); // Chain<br class="">+ SDValue NewResults[] = {<br class="">+ SDValue(LD, 0), // The result of load<br class="">+ SDValue(UpdN.getNode(), 2) // Chain<br class="">+ };<br class=""> DCI.CombineTo(LD, NewResults);<br class=""> DCI.CombineTo(N, SDValue(UpdN.getNode(), 0)); // Dup/Inserted Result<br class=""> DCI.CombineTo(User, SDValue(UpdN.getNode(), 1)); // Write back register<br class=""><br class="">Modified: llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h (original)<br class="">+++ llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h Sat Jul 2 06:41:39 2016<br class="">@@ -166,15 +166,15 @@ public:<br class=""> SmallVector<const MachineInstr *, 3> Args;<br class=""><br class=""> public:<br class="">- typedef SmallVectorImpl<const MachineInstr *> LOHArgs;<br class="">+ typedef ArrayRef<const MachineInstr *> LOHArgs;<br class=""><br class="">- MILOHDirective(MCLOHType Kind, const LOHArgs &Args)<br class="">+ MILOHDirective(MCLOHType Kind, LOHArgs Args)<br class=""> : Kind(Kind), Args(Args.begin(), Args.end()) {<br class=""> assert(isValidMCLOHType(Kind) && "Invalid LOH directive type!");<br class=""> }<br class=""><br class=""> MCLOHType getKind() const { return Kind; }<br class="">- const LOHArgs &getArgs() const { return Args; }<br class="">+ LOHArgs getArgs() const { return Args; }<br class=""> };<br class=""><br class=""> typedef MILOHDirective::LOHArgs MILOHArgs;<br class="">@@ -183,7 +183,7 @@ public:<br class=""> const MILOHContainer &getLOHContainer() const { return LOHContainerSet; }<br class=""><br class=""> /// Add a LOH directive of this @p Kind and this @p Args.<br class="">- void addLOHDirective(MCLOHType Kind, const MILOHArgs &Args) {<br class="">+ void addLOHDirective(MCLOHType Kind, MILOHArgs Args) {<br class=""> LOHContainerSet.push_back(MILOHDirective(Kind, Args));<br class=""> LOHRelated.insert(Args.begin(), Args.end());<br class=""> }<br class=""><br class="">Modified: llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp (original)<br class="">+++ llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -182,11 +182,8 @@ Value *GenericToNVVM::getOrInsertCVTA(Mo<br class=""> // Insert the address space conversion.<br class=""> Type *ResultType =<br class=""> PointerType::get(Type::getInt8Ty(Context), llvm::ADDRESS_SPACE_GENERIC);<br class="">- SmallVector<Type *, 2> ParamTypes;<br class="">- ParamTypes.push_back(ResultType);<br class="">- ParamTypes.push_back(DestTy);<br class=""> Function *CVTAFunction = Intrinsic::getDeclaration(<br class="">- M, Intrinsic::nvvm_ptr_global_to_gen, ParamTypes);<br class="">+ M, Intrinsic::nvvm_ptr_global_to_gen, {ResultType, DestTy});<br class=""> CVTA = Builder.CreateCall(CVTAFunction, CVTA, "cvta");<br class=""> // Another bitcast from i8 * to <the element type of GVType> * is<br class=""> // required.<br class=""><br class="">Modified: llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp (original)<br class="">+++ llvm/trunk/lib/Target/PowerPC/PPCTLSDynamicCall.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -73,10 +73,7 @@ protected:<br class=""> DebugLoc DL = MI->getDebugLoc();<br class=""> unsigned GPR3 = Is64Bit ? PPC::X3 : PPC::R3;<br class=""> unsigned Opc1, Opc2;<br class="">- SmallVector<unsigned, 4> OrigRegs;<br class="">- OrigRegs.push_back(OutReg);<br class="">- OrigRegs.push_back(InReg);<br class="">- OrigRegs.push_back(GPR3);<br class="">+ const unsigned OrigRegs[] = {OutReg, InReg, GPR3};<br class=""><br class=""> switch (MI->getOpcode()) {<br class=""> default:<br class=""><br class="">Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)<br class="">+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -2076,16 +2076,15 @@ SDValue SparcTargetLowering::LowerGlobal<br class=""> SDValue Symbol = withTargetFlags(Op, callTF, DAG);<br class=""><br class=""> SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);<br class="">- SmallVector<SDValue, 4> Ops;<br class="">- Ops.push_back(Chain);<br class="">- Ops.push_back(Callee);<br class="">- Ops.push_back(Symbol);<br class="">- Ops.push_back(DAG.getRegister(SP::O0, PtrVT));<br class=""> const uint32_t *Mask = Subtarget->getRegisterInfo()->getCallPreservedMask(<br class=""> DAG.getMachineFunction(), CallingConv::C);<br class=""> assert(Mask && "Missing call preserved mask for calling convention");<br class="">- Ops.push_back(DAG.getRegisterMask(Mask));<br class="">- Ops.push_back(InFlag);<br class="">+ SDValue Ops[] = {Chain,<br class="">+ Callee,<br class="">+ Symbol,<br class="">+ DAG.getRegister(SP::O0, PtrVT),<br class="">+ DAG.getRegisterMask(Mask),<br class="">+ InFlag};<br class=""> Chain = DAG.getNode(SPISD::TLS_CALL, DL, NodeTys, Ops);<br class=""> InFlag = Chain.getValue(1);<br class=""> Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(1, DL, true),<br class=""><br class="">Modified: llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp (original)<br class="">+++ llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -179,7 +179,6 @@ static bool isZeroLengthArray(Type *Ty)<br class=""><br class="">bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {<br class=""> Module *M = GV->getParent();<br class="">- LLVMContext &Ctx = M->getContext();<br class=""> if (!GV->isThreadLocal())<br class=""> return false;<br class=""><br class="">@@ -210,11 +209,8 @@ bool XCoreLowerThreadLocal::lowerGlobal(<br class=""> Function *GetID = Intrinsic::getDeclaration(GV->getParent(),<br class=""> Intrinsic::xcore_getid);<br class=""> Value *ThreadID = Builder.CreateCall(GetID, {});<br class="">- SmallVector<Value *, 2> Indices;<br class="">- Indices.push_back(Constant::getNullValue(Type::getInt64Ty(Ctx)));<br class="">- Indices.push_back(ThreadID);<br class="">- Value *Addr =<br class="">- Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV, Indices);<br class="">+ Value *Addr = Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV,<br class="">+ {Builder.getInt64(0), ThreadID});<br class=""> U->replaceUsesOfWith(GV, Addr);<br class=""> }<br class=""><br class=""><br class="">Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=274431&r1=274430&r2=274431&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=274431&r1=274430&r2=274431&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Sat Jul 2 06:41:39 2016<br class="">@@ -633,11 +633,8 @@ bool GCOVProfiler::emitProfileArcs() {<br class=""> Value *Sel = Builder.CreateSelect(BI->getCondition(),<br class=""> Builder.getInt64(Edge),<br class=""> Builder.getInt64(Edge + 1));<br class="">- SmallVector<Value *, 2> Idx;<br class="">- Idx.push_back(Builder.getInt64(0));<br class="">- Idx.push_back(Sel);<br class="">- Value *Counter = Builder.CreateInBoundsGEP(Counters->getValueType(),<br class="">- Counters, Idx);<br class="">+ Value *Counter = Builder.CreateInBoundsGEP(<br class="">+ Counters->getValueType(), Counters, {Builder.getInt64(0), Sel});<br class=""> Value *Count = Builder.CreateLoad(Counter);<br class=""> Count = Builder.CreateAdd(Count, Builder.getInt64(1));<br class=""> Builder.CreateStore(Count, Counter);<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></body></html>