diff --git a/docs/SIL.rst b/docs/SIL.rst index 36ece2092c9..2179aed18dd 100644 --- a/docs/SIL.rst +++ b/docs/SIL.rst @@ -1630,7 +1630,7 @@ alloc_stack ``````````` :: - sil-instruction ::= 'alloc_stack' sil-type + sil-instruction ::= 'alloc_stack' sil-type (',' debug-var-attr)* %1 = alloc_stack $T // %1#0 has type $*@local_storage T @@ -1697,7 +1697,7 @@ alloc_box ````````` :: - sil-instruction ::= 'alloc_box' sil-type + sil-instruction ::= 'alloc_box' sil-type (',' debug-var-attr)* %1 = alloc_box $T // %1 has two values: @@ -1886,7 +1886,7 @@ debug_value :: - sil-instruction ::= debug_value sil-operand + sil-instruction ::= debug_value sil-operand (',' debug-var-attr)* debug_value %1 : $Int @@ -1896,12 +1896,24 @@ the SILLocation attached to the debug_value instruction. The operand must have loadable type. +:: + + debug-var-attr ::= 'var' + debug-var-attr ::= 'let' + debug-var-attr ::= 'name' string-literal + debug-var-attr ::= 'argno' integer-literal + +There are a number of attributes that provide details about the source +variable that is being described, including the name of the +variable. For function and closure arguments ``argno`` is the number +of the function argument starting with 1. + debug_value_addr ```````````````` :: - sil-instruction ::= debug_value_addr sil-operand + sil-instruction ::= debug_value_addr sil-operand (',' debug-var-attr)* debug_value_addr %7 : $*SomeProtocol diff --git a/include/swift/AST/DiagnosticsParse.def b/include/swift/AST/DiagnosticsParse.def index 5c51f015ab4..3cbd855a324 100644 --- a/include/swift/AST/DiagnosticsParse.def +++ b/include/swift/AST/DiagnosticsParse.def @@ -485,6 +485,8 @@ ERROR(sil_missing_substitutions,decl_parsing,none, "missing substitutions", ()) ERROR(sil_too_many_substitutions,decl_parsing,none, "too many substitutions", ()) +ERROR(sil_dbg_unknown_key,decl_parsing,none, + "unknown key '%0' in debug variable declaration", (StringRef)) // SIL Basic Blocks ERROR(expected_sil_block_name, decl_parsing,none, diff --git a/include/swift/SIL/SILBuilder.h b/include/swift/SIL/SILBuilder.h index 34cf9d0a8cb..87840d4de96 100644 --- a/include/swift/SIL/SILBuilder.h +++ b/include/swift/SIL/SILBuilder.h @@ -221,10 +221,10 @@ public: //===--------------------------------------------------------------------===// AllocStackInst *createAllocStack(SILLocation Loc, SILType elementType, - unsigned ArgNo = 0) { + SILDebugVariable Var = SILDebugVariable()) { Loc.markAsPrologue(); - return insert(new (F.getModule()) AllocStackInst( - createSILDebugLocation(Loc), elementType, F, ArgNo)); + return insert(AllocStackInst::create(createSILDebugLocation(Loc), + elementType, F, Var)); } AllocRefInst *createAllocRef(SILLocation Loc, SILType elementType, bool objc, @@ -252,10 +252,10 @@ public: } AllocBoxInst *createAllocBox(SILLocation Loc, SILType ElementType, - unsigned ArgNo = 0) { + SILDebugVariable Var = SILDebugVariable()) { Loc.markAsPrologue(); - return insert(new (F.getModule()) AllocBoxInst(createSILDebugLocation(Loc), - ElementType, F, ArgNo)); + return insert( + AllocBoxInst::create(createSILDebugLocation(Loc), ElementType, F, Var)); } AllocExistentialBoxInst * @@ -436,14 +436,15 @@ public: } DebugValueInst *createDebugValue(SILLocation Loc, SILValue src, - unsigned ArgNo = 0) { - return insert(new (F.getModule()) - DebugValueInst(createSILDebugLocation(Loc), src, ArgNo)); + SILDebugVariable Var = SILDebugVariable()) { + return insert(DebugValueInst::create(createSILDebugLocation(Loc), src, + F.getModule(), Var)); } - DebugValueAddrInst *createDebugValueAddr(SILLocation Loc, SILValue src, - unsigned ArgNo = 0) { - return insert(new (F.getModule()) DebugValueAddrInst( - createSILDebugLocation(Loc), src, ArgNo)); + DebugValueAddrInst * + createDebugValueAddr(SILLocation Loc, SILValue src, + SILDebugVariable Var = SILDebugVariable()) { + return insert(DebugValueAddrInst::create(createSILDebugLocation(Loc), src, + F.getModule(), Var)); } LoadWeakInst *createLoadWeak(SILLocation Loc, SILValue src, IsTake_t isTake) { diff --git a/include/swift/SIL/SILCloner.h b/include/swift/SIL/SILCloner.h index 91b7fb230a7..4d0cd8d3bd3 100644 --- a/include/swift/SIL/SILCloner.h +++ b/include/swift/SIL/SILCloner.h @@ -670,7 +670,7 @@ SILCloner::visitDebugValueInst(DebugValueInst *Inst) { getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope())); doPostProcess(Inst, getBuilder().createDebugValue( Inst->getLoc(), getOpValue(Inst->getOperand()), - Inst->getVarInfo().getArgNo())); + Inst->getVarInfo())); } template void @@ -684,9 +684,8 @@ SILCloner::visitDebugValueAddrInst(DebugValueAddrInst *Inst) { // Do not remap the location for a debug Instruction. SILValue OpValue = getOpValue(Inst->getOperand()); getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope())); - doPostProcess( - Inst, getBuilder().createDebugValueAddr(Inst->getLoc(), OpValue, - Inst->getVarInfo().getArgNo())); + doPostProcess(Inst, getBuilder().createDebugValueAddr( + Inst->getLoc(), OpValue, Inst->getVarInfo())); } diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index d3b8af96703..b4043ea119c 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -341,13 +341,45 @@ public: /// Holds common debug information about local variables and function /// arguments that are needed by DebugValueInst, DebugValueAddrInst, /// AllocStackInst, and AllocBoxInst. -class DebugVariable { +struct SILDebugVariable { + SILDebugVariable() : Constant(true), ArgNo(0) {} + SILDebugVariable(bool Constant, unsigned ArgNo) + : Constant(Constant), ArgNo(ArgNo) {} + SILDebugVariable(StringRef Name, bool Constant, unsigned ArgNo) + : Name(Name), Constant(Constant), ArgNo(ArgNo) {} + StringRef Name; + bool Constant; + unsigned ArgNo; +}; + +/// A DebugVariable where storage for the strings has been +/// tail-allocated following the parent SILInstruction. +class TailAllocatedDebugVariable { /// The source function argument position from left to right /// starting with 1 or 0 if this is a local variable. - unsigned char ArgNo; + unsigned ArgNo : 16; + /// When this is nonzero there is a tail-allocated string storing + /// variable name present. This typically only happens for + /// instructions that were created from parsing SIL assembler. + unsigned NameLength : 15; + bool Constant : 1; public: - DebugVariable(unsigned ArgNo) : ArgNo(ArgNo) {}; + TailAllocatedDebugVariable(SILDebugVariable DbgVar, char *buf); + unsigned getArgNo() const { return ArgNo; } + void setArgNo(unsigned N) { ArgNo = N; } + /// Returns the name of the source variable, if it is stored in the + /// instruction. + StringRef getName(const char *buf) const; + bool isLet() const { return Constant; } + + SILDebugVariable get(VarDecl *VD, const char *buf) const { + if (VD) + return {VD->getName().empty() ? "" : VD->getName().str(), VD->isLet(), + getArgNo()}; + else + return {getName(buf), isLet(), getArgNo()}; + } }; //===----------------------------------------------------------------------===// @@ -394,19 +426,24 @@ public: /// reference count) stack memory. The memory is provided uninitialized. class AllocStackInst : public AllocationInst { friend class SILBuilder; - DebugVariable VarInfo; + TailAllocatedDebugVariable VarInfo; AllocStackInst(SILDebugLocation *Loc, SILType elementType, SILFunction &F, - unsigned ArgNo); + SILDebugVariable Var); + static AllocStackInst *create(SILDebugLocation *Loc, SILType elementType, + SILFunction &F, SILDebugVariable Var); public: - /// getDecl - Return the underlying variable declaration associated with this + /// Return the underlying variable declaration associated with this /// allocation, or null if this is a temporary allocation. VarDecl *getDecl() const; - DebugVariable getVarInfo() const { return VarInfo; }; - void setArgNo(unsigned N) { VarInfo = DebugVariable(N); } + /// Return the debug variable information attached to this instruction. + SILDebugVariable getVarInfo() const { + return VarInfo.get(getDecl(), reinterpret_cast(this + 1)); + }; + void setArgNo(unsigned N) { VarInfo.setArgNo(N); } /// getElementType - Get the type of the allocated memory (as opposed to the /// (second) type of the instruction itself, which will be an address type). @@ -494,10 +531,12 @@ public: class AllocBoxInst : public AllocationInst { friend class SILBuilder; - DebugVariable VarInfo; + TailAllocatedDebugVariable VarInfo; AllocBoxInst(SILDebugLocation *DebugLoc, SILType ElementType, SILFunction &F, - unsigned ArgNo); + SILDebugVariable Var); + static AllocBoxInst *create(SILDebugLocation *Loc, SILType elementType, + SILFunction &F, SILDebugVariable Var); public: @@ -508,11 +547,14 @@ public: SILValue getContainerResult() const { return SILValue(this, 0); } SILValue getAddressResult() const { return SILValue(this, 1); } - /// getDecl - Return the underlying variable declaration associated with this + /// Return the underlying variable declaration associated with this /// allocation, or null if this is a temporary allocation. VarDecl *getDecl() const; - DebugVariable getVarInfo() const { return VarInfo; }; + /// Return the debug variable information attached to this instruction. + SILDebugVariable getVarInfo() const { + return VarInfo.get(getDecl(), reinterpret_cast(this + 1)); + }; ArrayRef getAllOperands() const { return {}; } MutableArrayRef getAllOperands() { return {}; } @@ -1377,16 +1419,21 @@ public: /// types). class DebugValueInst : public UnaryInstructionBase { friend class SILBuilder; - DebugVariable VarInfo; + TailAllocatedDebugVariable VarInfo; - DebugValueInst(SILDebugLocation *DebugLoc, SILValue Operand, unsigned ArgNo) - : UnaryInstructionBase(DebugLoc, Operand), VarInfo(ArgNo) {} + DebugValueInst(SILDebugLocation *DebugLoc, SILValue Operand, + SILDebugVariable Var); + static DebugValueInst *create(SILDebugLocation *DebugLoc, SILValue Operand, + SILModule &M, SILDebugVariable Var); public: - /// getDecl - Return the underlying variable declaration that this denotes, + /// Return the underlying variable declaration that this denotes, /// or null if we don't have one. VarDecl *getDecl() const; - DebugVariable getVarInfo() const { return VarInfo; } + /// Return the debug variable information attached to this instruction. + SILDebugVariable getVarInfo() const { + return VarInfo.get(getDecl(), reinterpret_cast(this + 1)); + } }; /// Define the start or update to a symbolic variable value (for address-only @@ -1394,17 +1441,22 @@ public: class DebugValueAddrInst : public UnaryInstructionBase { friend class SILBuilder; - DebugVariable VarInfo; + TailAllocatedDebugVariable VarInfo; DebugValueAddrInst(SILDebugLocation *DebugLoc, SILValue Operand, - unsigned ArgNo) - : UnaryInstructionBase(DebugLoc, Operand), VarInfo(ArgNo) {} + SILDebugVariable Var); + static DebugValueAddrInst *create(SILDebugLocation *DebugLoc, + SILValue Operand, SILModule &M, + SILDebugVariable Var); public: - /// getDecl - Return the underlying variable declaration that this denotes, + /// Return the underlying variable declaration that this denotes, /// or null if we don't have one. VarDecl *getDecl() const; - DebugVariable getVarInfo() const { return VarInfo; } + /// Return the debug variable information attached to this instruction. + SILDebugVariable getVarInfo() const { + return VarInfo.get(getDecl(), reinterpret_cast(this + 1)); + }; }; diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index cc3676c368e..86a486120a6 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -2955,7 +2955,7 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) { llvm::SmallVector Copy; emitShadowCopy(e.claimAll(), Name, Copy); emitDebugVariableDeclaration(Copy, DbgTy, i->getDebugScope(), Name, - i->getVarInfo().getArgNo()); + i->getVarInfo().ArgNo); } void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) { @@ -2975,7 +2975,7 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) { // Put the value into a stack slot at -Onone and emit a debug intrinsic. emitDebugVariableDeclaration(emitShadowCopy(Addr, Name), DbgTy, i->getDebugScope(), Name, - i->getVarInfo().getArgNo(), IndirectValue); + i->getVarInfo().ArgNo, IndirectValue); } void IRGenSILFunction::visitLoadWeakInst(swift::LoadWeakInst *i) { @@ -3235,7 +3235,7 @@ static void emitDebugDeclarationForAllocStack(IRGenSILFunction &IGF, if (DS) { assert(DS->SILFn == IGF.CurSILFn || DS->InlinedCallSite); IGF.emitDebugVariableDeclaration(addr, DbgTy, DS, Name, - i->getVarInfo().getArgNo()); + i->getVarInfo().ArgNo); } } } diff --git a/lib/Parse/ParseSIL.cpp b/lib/Parse/ParseSIL.cpp index 581f0c6fa8a..5ee6810d40b 100644 --- a/lib/Parse/ParseSIL.cpp +++ b/lib/Parse/ParseSIL.cpp @@ -247,6 +247,7 @@ namespace { } bool parseSILOpcode(ValueKind &Opcode, SourceLoc &OpcodeLoc, StringRef &OpcodeName); + bool parseSILDebugVar(SILDebugVariable &Var); /// \brief Parses the basic block arguments as part of branch instruction. bool parseSILBBArgsAtBranch(SmallVector &Args, SILBuilder &B); @@ -1322,6 +1323,40 @@ bool SILParser::parseSILOpcode(ValueKind &Opcode, SourceLoc &OpcodeLoc, return true; } +bool SILParser::parseSILDebugVar(SILDebugVariable &Var) { + while (P.Tok.is(tok::comma)) { + P.consumeToken(); + StringRef Key = P.Tok.getText(); + if (Key == "name") { + P.consumeToken(); + if (P.Tok.getKind() != tok::string_literal) { + P.diagnose(P.Tok, diag::expected_tok_in_sil_instr, "string"); + return true; + } + // Drop the double quotes. + StringRef Val = P.Tok.getText().drop_front().drop_back(); + Var.Name = Val; + } else if (Key == "argno") { + P.consumeToken(); + if (P.Tok.getKind() != tok::integer_literal) { + P.diagnose(P.Tok, diag::expected_tok_in_sil_instr, "integer"); + return true; + } + if (P.Tok.getText().getAsInteger(0, Var.ArgNo)) + return true; + } else if (Key == "let") { + Var.Constant = true; + } else if (Key == "var") { + Var.Constant = false; + } else { + P.diagnose(P.Tok, diag::sil_dbg_unknown_key, Key); + return true; + } + P.consumeToken(); + } + return false; +} + bool SILParser::parseSILBBArgsAtBranch(SmallVector &Args, SILBuilder &B) { if (P.Tok.is(tok::l_paren)) { @@ -1659,7 +1694,10 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB) { case ValueKind::AllocBoxInst: { SILType Ty; if (parseSILType(Ty)) return true; - ResultVal = B.createAllocBox(InstLoc, Ty); + SILDebugVariable VarInfo; + if (parseSILDebugVar(VarInfo)) + return true; + ResultVal = B.createAllocBox(InstLoc, Ty, VarInfo); break; } case ValueKind::ApplyInst: @@ -1944,34 +1982,47 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB) { UNARY_INSTRUCTION(RetainValue) UNARY_INSTRUCTION(Load) UNARY_INSTRUCTION(CondFail) - UNARY_INSTRUCTION(DebugValue) - UNARY_INSTRUCTION(DebugValueAddr) #undef UNARY_INSTRUCTION - case ValueKind::LoadUnownedInst: - case ValueKind::LoadWeakInst: { - bool isTake = false; - SourceLoc addrLoc; - if (parseSILOptional(isTake, *this, "take") || - parseTypedValueRef(Val, addrLoc, B)) - return true; + case ValueKind::DebugValueInst: + case ValueKind::DebugValueAddrInst: { + if (parseTypedValueRef(Val, B)) + return true; - if (Opcode == ValueKind::LoadUnownedInst) { - if (!Val.getType().is()) { - P.diagnose(addrLoc, diag::sil_operand_not_unowned_address, - "source", OpcodeName); - } - ResultVal = B.createLoadUnowned(InstLoc, Val, IsTake_t(isTake)); + SILDebugVariable VarInfo; + if (parseSILDebugVar(VarInfo)) + return true; + if (Opcode == ValueKind::DebugValueInst) + ResultVal = B.createDebugValue(InstLoc, Val, VarInfo); + else + ResultVal = B.createDebugValueAddr(InstLoc, Val, VarInfo); + break; + } - } else { - if (!Val.getType().is()) { - P.diagnose(addrLoc, diag::sil_operand_not_weak_address, - "source", OpcodeName); - } - ResultVal = B.createLoadWeak(InstLoc, Val, IsTake_t(isTake)); - } + case ValueKind::LoadUnownedInst: + case ValueKind::LoadWeakInst: { + bool isTake = false; + SourceLoc addrLoc; + if (parseSILOptional(isTake, *this, "take") || + parseTypedValueRef(Val, addrLoc, B)) + return true; - break; + if (Opcode == ValueKind::LoadUnownedInst) { + if (!Val.getType().is()) { + P.diagnose(addrLoc, diag::sil_operand_not_unowned_address, "source", + OpcodeName); + } + ResultVal = B.createLoadUnowned(InstLoc, Val, IsTake_t(isTake)); + + } else { + if (!Val.getType().is()) { + P.diagnose(addrLoc, diag::sil_operand_not_weak_address, "source", + OpcodeName); + } + ResultVal = B.createLoadWeak(InstLoc, Val, IsTake_t(isTake)); + } + + break; } case ValueKind::MarkDependenceInst: { @@ -2353,10 +2404,13 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB) { SILType Ty; if (parseSILType(Ty)) return true; - - if (Opcode == ValueKind::AllocStackInst) - ResultVal = B.createAllocStack(InstLoc, Ty); - else if (Opcode == ValueKind::AllocRefInst) + + if (Opcode == ValueKind::AllocStackInst) { + SILDebugVariable VarInfo; + if (parseSILDebugVar(VarInfo)) + return true; + ResultVal = B.createAllocStack(InstLoc, Ty, VarInfo); + } else if (Opcode == ValueKind::AllocRefInst) ResultVal = B.createAllocRef(InstLoc, Ty, IsObjC, OnStack); else { assert(Opcode == ValueKind::MetatypeInst); diff --git a/lib/SIL/SILInstructions.cpp b/lib/SIL/SILInstructions.cpp index 454391df11f..a3f6022234a 100644 --- a/lib/SIL/SILInstructions.cpp +++ b/lib/SIL/SILInstructions.cpp @@ -45,10 +45,36 @@ static SILTypeList *getAllocStackType(SILType eltTy, SILFunction &F) { return F.getModule().getSILTypeList(resTys); } +template +static void *allocateDebugVarCarryingInst(SILModule &M, SILDebugVariable Var) { + return M.allocateInst(sizeof(INST) + Var.Name.size(), alignof(INST)); +} + +TailAllocatedDebugVariable::TailAllocatedDebugVariable(SILDebugVariable Var, + char *buf) + : ArgNo(Var.ArgNo), NameLength(Var.Name.size()) { + assert((Var.ArgNo < (2<<16)) && "too many arguments"); + assert((NameLength < (2<<15)) && "variable name too long"); + memcpy(buf, Var.Name.data(), NameLength); +} + +StringRef TailAllocatedDebugVariable::getName(const char *buf) const { + return NameLength ? StringRef(buf, NameLength) : StringRef(); +} + AllocStackInst::AllocStackInst(SILDebugLocation *Loc, SILType elementType, - SILFunction &F, unsigned ArgNo) + SILFunction &F, SILDebugVariable Var) : AllocationInst(ValueKind::AllocStackInst, Loc, - getAllocStackType(elementType, F)), VarInfo(ArgNo) {} + getAllocStackType(elementType, F)), + VarInfo(Var, reinterpret_cast(this + 1)) {} + +AllocStackInst *AllocStackInst::create(SILDebugLocation *Loc, + SILType elementType, SILFunction &F, + SILDebugVariable Var) { + void *buf = allocateDebugVarCarryingInst(F.getModule(), Var); + return ::new (buf) + AllocStackInst(Loc, elementType, F, Var); +} /// getDecl - Return the underlying variable declaration associated with this /// allocation, or null if this is a temporary allocation. @@ -75,10 +101,16 @@ static SILTypeList *getAllocBoxType(SILType EltTy, SILFunction &F) { } AllocBoxInst::AllocBoxInst(SILDebugLocation *Loc, SILType ElementType, - SILFunction &F, unsigned ArgNo) + SILFunction &F, SILDebugVariable Var) : AllocationInst(ValueKind::AllocBoxInst, Loc, getAllocBoxType(ElementType, F)), - VarInfo(ArgNo) {} + VarInfo(Var, reinterpret_cast(this + 1)) {} + +AllocBoxInst *AllocBoxInst::create(SILDebugLocation *Loc, SILType ElementType, + SILFunction &F, SILDebugVariable Var) { + void *buf = allocateDebugVarCarryingInst(F.getModule(), Var); + return ::new (buf) AllocBoxInst(Loc, ElementType, F, Var); +} /// getDecl - Return the underlying variable declaration associated with this /// allocation, or null if this is a temporary allocation. @@ -86,6 +118,30 @@ VarDecl *AllocBoxInst::getDecl() const { return getLoc().getAsASTNode(); } +DebugValueInst::DebugValueInst(SILDebugLocation *DebugLoc, SILValue Operand, + SILDebugVariable Var) + : UnaryInstructionBase(DebugLoc, Operand), + VarInfo(Var, reinterpret_cast(this + 1)) {} + +DebugValueInst *DebugValueInst::create(SILDebugLocation *DebugLoc, + SILValue Operand, SILModule &M, + SILDebugVariable Var) { + void *buf = allocateDebugVarCarryingInst(M, Var); + return ::new (buf) DebugValueInst(DebugLoc, Operand, Var); +} + +DebugValueAddrInst::DebugValueAddrInst(SILDebugLocation *DebugLoc, + SILValue Operand, SILDebugVariable Var) + : UnaryInstructionBase(DebugLoc, Operand), + VarInfo(Var, reinterpret_cast(this + 1)) {} + +DebugValueAddrInst *DebugValueAddrInst::create(SILDebugLocation *DebugLoc, + SILValue Operand, SILModule &M, + SILDebugVariable Var) { + void *buf = allocateDebugVarCarryingInst(M, Var); + return ::new (buf) DebugValueAddrInst(DebugLoc, Operand, Var); +} + VarDecl *DebugValueInst::getDecl() const { return getLoc().getAsASTNode(); } diff --git a/lib/SIL/SILPrinter.cpp b/lib/SIL/SILPrinter.cpp index 24475ab39a5..69ba2a95649 100644 --- a/lib/SIL/SILPrinter.cpp +++ b/lib/SIL/SILPrinter.cpp @@ -686,18 +686,21 @@ public: *this << "undef<" << A->getType() << ">"; } - template - void printVarDeclComment(VarDeclaringInst *VDI) { - if (VarDecl *VD = VDI->getDecl()) { - *this << " // " << (VD->isLet() ? "let " : "var ") << VD->getName(); - if (unsigned N = VDI->getVarInfo().getArgNo()) - *this << ", argno: " << N; - } - } + void printDebugVar(SILDebugVariable Var) { + if (Var.Name.empty()) + return; + if (Var.Constant) + *this << ", let"; + else + *this << ", var"; + *this << ", name \"" << Var.Name << '"'; + if (Var.ArgNo) + *this << ", argno " << Var.ArgNo; + } void visitAllocStackInst(AllocStackInst *AVI) { *this << "alloc_stack " << AVI->getElementType(); - printVarDeclComment(AVI); + printDebugVar(AVI->getVarInfo()); } void visitAllocRefInst(AllocRefInst *ARI) { @@ -724,7 +727,7 @@ public: void visitAllocBoxInst(AllocBoxInst *ABI) { *this << "alloc_box " << ABI->getElementType(); - printVarDeclComment(ABI); + printDebugVar(ABI->getVarInfo()); } void printSubstitutions(ArrayRef Subs) { @@ -866,12 +869,12 @@ public: void visitDebugValueInst(DebugValueInst *DVI) { *this << "debug_value " << getIDAndType(DVI->getOperand()); - printVarDeclComment(DVI); + printDebugVar(DVI->getVarInfo()); } void visitDebugValueAddrInst(DebugValueAddrInst *DVAI) { *this << "debug_value_addr " << getIDAndType(DVAI->getOperand()); - printVarDeclComment(DVAI); + printDebugVar(DVAI->getVarInfo()); } void visitLoadUnownedInst(LoadUnownedInst *LI) { diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index 19814230c31..f7eed83383e 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -250,7 +250,8 @@ public: // The variable may have its lifetime extended by a closure, heap-allocate // it using a box. - AllocBoxInst *allocBox = SGF.B.createAllocBox(decl, lType, ArgNo); + AllocBoxInst *allocBox = + SGF.B.createAllocBox(decl, lType, {decl->isLet(), ArgNo}); auto box = SILValue(allocBox, 0); auto addr = SILValue(allocBox, 1); diff --git a/lib/SILGen/SILGenProlog.cpp b/lib/SILGen/SILGenProlog.cpp index 022696962cf..7063a25508a 100644 --- a/lib/SILGen/SILGenProlog.cpp +++ b/lib/SILGen/SILGenProlog.cpp @@ -28,7 +28,7 @@ SILValue SILGenFunction::emitSelfDecl(VarDecl *selfDecl) { SILLocation PrologueLoc(selfDecl); PrologueLoc.markAsPrologue(); unsigned ArgNo = 1; // Hardcoded for destructors. - B.createDebugValue(PrologueLoc, selfValue, ArgNo); + B.createDebugValue(PrologueLoc, selfValue, {selfDecl->isLet(), ArgNo}); return selfValue; } @@ -256,7 +256,7 @@ struct ArgumentInitVisitor : if (isa(objectType)) { // FIXME: mark a debug location? gen.VarLocs[vd] = SILGenFunction::VarLoc::get(address); - gen.B.createDebugValueAddr(loc, address, ArgNo); + gen.B.createDebugValueAddr(loc, address, {vd->isLet(), ArgNo}); return; } @@ -278,9 +278,9 @@ struct ArgumentInitVisitor : // argument if we're responsible for it. gen.VarLocs[vd] = SILGenFunction::VarLoc::get(argrv.getValue()); if (argrv.getType().isAddress()) - gen.B.createDebugValueAddr(loc, argrv.getValue(), ArgNo); + gen.B.createDebugValueAddr(loc, argrv.getValue(), {vd->isLet(), ArgNo}); else - gen.B.createDebugValue(loc, argrv.getValue(), ArgNo); + gen.B.createDebugValue(loc, argrv.getValue(), {vd->isLet(), ArgNo}); } else { // If the variable is mutable, we need to copy or move the argument // value to local mutable memory. @@ -464,7 +464,7 @@ static void emitCaptureArguments(SILGenFunction &gen, CapturedValue capture, if (auto *AllocStack = dyn_cast(val)) AllocStack->setArgNo(ArgNo); else - gen.B.createDebugValue(Loc, val, ArgNo); + gen.B.createDebugValue(Loc, val, {/*Constant*/true, ArgNo}); if (!lowering.isTrivial()) gen.enterDestroyCleanup(val); break; @@ -479,7 +479,7 @@ static void emitCaptureArguments(SILGenFunction &gen, CapturedValue capture, SILValue box = new (gen.SGM.M) SILArgument(gen.F.begin(), boxTy, VD); SILValue addr = gen.B.createProjectBox(VD, box); gen.VarLocs[VD] = SILGenFunction::VarLoc::get(addr, box); - gen.B.createDebugValueAddr(Loc, addr, ArgNo); + gen.B.createDebugValueAddr(Loc, addr, {/*Constant*/false, ArgNo}); gen.Cleanups.pushCleanup(box); break; } @@ -488,7 +488,7 @@ static void emitCaptureArguments(SILGenFunction &gen, CapturedValue capture, SILType ty = gen.getLoweredType(type).getAddressType(); SILValue addr = new (gen.SGM.M) SILArgument(gen.F.begin(), ty, VD); gen.VarLocs[VD] = SILGenFunction::VarLoc::get(addr); - gen.B.createDebugValueAddr(Loc, addr, ArgNo); + gen.B.createDebugValueAddr(Loc, addr, {/*Constant*/true, ArgNo}); break; } } diff --git a/lib/SILOptimizer/IPO/CapturePromotion.cpp b/lib/SILOptimizer/IPO/CapturePromotion.cpp index f393a50676e..6a1c72ddb1d 100644 --- a/lib/SILOptimizer/IPO/CapturePromotion.cpp +++ b/lib/SILOptimizer/IPO/CapturePromotion.cpp @@ -501,7 +501,7 @@ void ClosureCloner::visitDebugValueAddrInst(DebugValueAddrInst *Inst) { if (I != ProjectBoxArgumentMap.end()) { getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope())); getBuilder().createDebugValue(Inst->getLoc(), I->second, - Inst->getVarInfo().getArgNo()); + Inst->getVarInfo()); return; } } diff --git a/lib/SILOptimizer/Mandatory/InOutDeshadowing.cpp b/lib/SILOptimizer/Mandatory/InOutDeshadowing.cpp index 00945840e2f..90acd99e19d 100644 --- a/lib/SILOptimizer/Mandatory/InOutDeshadowing.cpp +++ b/lib/SILOptimizer/Mandatory/InOutDeshadowing.cpp @@ -72,8 +72,7 @@ static void promoteShadow(AllocStackInst *Alloc, SILArgument *InOutArg) { } // Make the debug information stored in the AllocBox explicit. SILBuilder B(Alloc); - B.createDebugValueAddr(Alloc->getLoc(), InOutArg, - Alloc->getVarInfo().getArgNo()); + B.createDebugValueAddr(Alloc->getLoc(), InOutArg, Alloc->getVarInfo()); Alloc->eraseFromParent(); } diff --git a/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp b/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp index 171262bea26..37957d70b78 100644 --- a/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp +++ b/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp @@ -212,7 +212,8 @@ void PartialApplyCombiner::allocateTemporaries() { (Param.isConsumed() && Param.isIndirect())) { Builder.setInsertionPoint(PAI->getFunction()->begin()->begin()); // Create a new temporary at the beginning of a function. - auto *Tmp = Builder.createAllocStack(PAI->getLoc(), Arg.getType(), AI); + auto *Tmp = Builder.createAllocStack(PAI->getLoc(), Arg.getType(), + {/*Constant*/ true, AI}); Builder.setInsertionPoint(PAI); // Copy argument into this temporary. Builder.createCopyAddr(PAI->getLoc(), Arg, SILValue(Tmp, 1), diff --git a/lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp b/lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp index 54dd9b7b459..826cd618d6b 100644 --- a/lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp +++ b/lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp @@ -297,9 +297,8 @@ SILInstruction *SILCombiner::visitAllocStackInst(AllocStackInst *AS) { // init_existential_addr then we can promote the allocation of the init // existential. if (IEI && !OEI) { - auto *ConcAlloc = - Builder.createAllocStack(AS->getLoc(), IEI->getLoweredConcreteType(), - AS->getVarInfo().getArgNo()); + auto *ConcAlloc = Builder.createAllocStack( + AS->getLoc(), IEI->getLoweredConcreteType(), AS->getVarInfo()); SILValue(IEI, 0).replaceAllUsesWith(ConcAlloc->getAddressResult()); eraseInstFromFunction(*IEI); diff --git a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp index e38f24fddbb..ad033e8b2cf 100644 --- a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp +++ b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp @@ -409,7 +409,7 @@ static bool rewriteAllocBoxAsAllocStack(AllocBoxInst *ABI, SILBuilder BuildAlloc(&Entry, Entry.begin()); BuildAlloc.setCurrentDebugScope(ABI->getDebugScope()); auto *ASI = BuildAlloc.createAllocStack(ABI->getLoc(), ABI->getElementType(), - ABI->getVarInfo().getArgNo()); + ABI->getVarInfo()); // Replace all uses of the address of the box's contained value with // the address of the stack location. diff --git a/lib/SILOptimizer/Transforms/SILMem2Reg.cpp b/lib/SILOptimizer/Transforms/SILMem2Reg.cpp index 80b14534595..b0db56610b0 100644 --- a/lib/SILOptimizer/Transforms/SILMem2Reg.cpp +++ b/lib/SILOptimizer/Transforms/SILMem2Reg.cpp @@ -282,7 +282,7 @@ promoteDebugValueAddr(DebugValueAddrInst *DVAI, SILValue Value, SILBuilder &B) { assert(Value.isValid() && "Expected valid value"); B.setInsertionPoint(DVAI); B.setCurrentDebugScope(DVAI->getDebugScope()); - B.createDebugValue(DVAI->getLoc(), Value, DVAI->getVarInfo().getArgNo()); + B.createDebugValue(DVAI->getLoc(), Value, DVAI->getVarInfo()); DVAI->eraseFromParent(); } diff --git a/test/DebugInfo/allocstack.swift b/test/DebugInfo/allocstack.swift index 86d95255f45..4534f3cd9ef 100644 --- a/test/DebugInfo/allocstack.swift +++ b/test/DebugInfo/allocstack.swift @@ -6,10 +6,10 @@ import StdlibUnittest // mandatory SIL optimization passes. func main() { - // CHECK-SIL-DAG: debug_value {{.*}}let x + // CHECK-SIL-DAG: debug_value {{.*}}: $Int, let, name "x" // CHECK-DAG: DILocalVariable(name: "x" let x = 10 - // CHECK-SIL-DAG: alloc_stack {{.*}}var y + // CHECK-SIL-DAG: alloc_stack $Int, var, name "y" // CHECK-DAG: DILocalVariable(name: "y" var y = 10 // The expression x+y may become constant folded. diff --git a/test/DebugInfo/debug_value_addr.swift b/test/DebugInfo/debug_value_addr.swift index 0c373893b33..f4f2baa5f11 100644 --- a/test/DebugInfo/debug_value_addr.swift +++ b/test/DebugInfo/debug_value_addr.swift @@ -5,7 +5,7 @@ // instructions. // CHECK-SIL: sil hidden @_TF16debug_value_addr4testurFxT_ -// CHECK-SIL: debug_value_addr %0 : $*T // let t +// CHECK-SIL: debug_value_addr %0 : $*T, let, name "t" // CHECK: define {{.*}}_TF16debug_value_addr4testurFxT_ // CHECK: entry: diff --git a/test/DebugInfo/simple.sil b/test/DebugInfo/simple.sil index 04effb922db..c5fdc1785af 100644 --- a/test/DebugInfo/simple.sil +++ b/test/DebugInfo/simple.sil @@ -7,7 +7,7 @@ import Swift sil @square : $@convention(thin) (Int32) -> Int32 { bb0(%0 : $Int32): - debug_value %0 : $Int32 // let x // id: %1 + debug_value %0 : $Int32, let, name "x" // id: %1 %3 = struct_extract %0 : $Int32, #Int32._value // user: %6 %4 = struct_extract %0 : $Int32, #Int32._value // user: %6 %5 = integer_literal $Builtin.Int1, -1 // user: %6 diff --git a/test/IRGen/dynamic_self.sil b/test/IRGen/dynamic_self.sil index e4cbbb5d685..c1eb378b901 100644 --- a/test/IRGen/dynamic_self.sil +++ b/test/IRGen/dynamic_self.sil @@ -14,7 +14,7 @@ protocol P { // CHECK-LABEL: define void @_TF12dynamic_self23testExistentialDispatchFT1pPS_1P__T_ sil @_TF12dynamic_self23testExistentialDispatchFT1pPS_1P__T_ : $@convention(thin) (@in P) -> () { bb0(%0 : $*P): - debug_value_addr %0 : $*P // let p // id: %1 + debug_value_addr %0 : $*P, let, name "p" // id: %1 %2 = alloc_stack $P // users: %3, %4, %12 copy_addr %0 to [initialization] %2#1 : $*P // id: %3 // CHECK: call %swift.opaque* diff --git a/test/IRGen/protocol_extensions.sil b/test/IRGen/protocol_extensions.sil index b7b06ca5d37..e02daf32c1a 100644 --- a/test/IRGen/protocol_extensions.sil +++ b/test/IRGen/protocol_extensions.sil @@ -16,7 +16,7 @@ extension P1 { // CHECK-LABEL: define hidden void @_TFP19protocol_extensions2P16extP1aUS0___fQPS0_FT_T_ sil hidden @_TFP19protocol_extensions2P16extP1aUS0___fQPS0_FT_T_ : $@convention(method) (@in Self) -> () { bb0(%0 : $*Self): - debug_value_addr %0 : $*Self // let self // id: %1 + debug_value_addr %0 : $*Self, let, name "self" // id: %1 %2 = witness_method $Self, #P1.reqP1a!1 : $@convention(witness_method) <τ_0_0 where τ_0_0 : P1> (@in_guaranteed τ_0_0) -> () // user: %3 %3 = apply %2(%0) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P1> (@in_guaranteed τ_0_0) -> () destroy_addr %0 : $*Self // id: %4 @@ -27,7 +27,7 @@ bb0(%0 : $*Self): // CHECK-LABEL: define void @_TFP19protocol_extensions2P16extP1bUS0___fQPS0_FT_T_ sil @_TFP19protocol_extensions2P16extP1bUS0___fQPS0_FT_T_ : $@convention(method) (@in Self) -> () { bb0(%0 : $*Self): - debug_value_addr %0 : $*Self // let self // id: %1 + debug_value_addr %0 : $*Self, let, name "self" // id: %1 // function_ref protocol_extensions.P1.extP1a (protocol_extensions.P1.Self)() -> () %2 = function_ref @_TFP19protocol_extensions2P16extP1aUS0___fQPS0_FT_T_ : $@convention(method) <τ_0_0 where τ_0_0 : P1> (@in τ_0_0) -> () // user: %5 %3 = alloc_stack $Self // users: %4, %5, %6 diff --git a/test/SILGen/address_only_types.swift b/test/SILGen/address_only_types.swift index 2e625921be5..fc69e8eb6ed 100644 --- a/test/SILGen/address_only_types.swift +++ b/test/SILGen/address_only_types.swift @@ -30,8 +30,8 @@ func address_only_ignored_argument(_: Unloadable) { // CHECK-LABEL: sil hidden @_TF18address_only_types30address_only_curried_arguments func address_only_curried_arguments(x: Unloadable)(y: Unloadable) { // CHECK: bb0([[YARG:%[0-9]+]] : $*Unloadable, [[XARG:%[0-9]+]] : $*Unloadable): - // CHECK-NEXT: debug_value_addr [[YARG]] : $*Unloadable // let y - // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable // let x + // CHECK-NEXT: debug_value_addr [[YARG]] : $*Unloadable, let, name "y" + // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable, let, name "x" // CHECK-NEXT: destroy_addr [[XARG]] // CHECK-NEXT: destroy_addr [[YARG]] // CHECK-NEXT: tuple @@ -41,8 +41,8 @@ func address_only_curried_arguments(x: Unloadable)(y: Unloadable) { // CHECK-LABEL: sil hidden @_TF18address_only_types41address_only_curried_arguments_and_return func address_only_curried_arguments_and_return(x: Unloadable)(y: Unloadable) -> Unloadable { // CHECK: bb0([[RET:%[0-9]+]] : $*Unloadable, [[YARG:%[0-9]+]] : $*Unloadable, [[XARG:%[0-9]+]] : $*Unloadable): - // CHECK-NEXT: debug_value_addr [[YARG]] : $*Unloadable // let y - // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable // let x + // CHECK-NEXT: debug_value_addr [[YARG]] : $*Unloadable, let, name "y" + // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable, let, name "x" // CHECK-NEXT: copy_addr [take] [[XARG]] to [initialization] [[RET]] // CHECK-NEXT: destroy_addr [[YARG]] // CHECK-NEXT: tuple @@ -53,8 +53,8 @@ func address_only_curried_arguments_and_return(x: Unloadable)(y: Unloadable) -> // CHECK-LABEL: sil hidden @_TF18address_only_types19address_only_return func address_only_return(x: Unloadable, y: Int) -> Unloadable { // CHECK: bb0([[RET:%[0-9]+]] : $*Unloadable, [[XARG:%[0-9]+]] : $*Unloadable, [[YARG:%[0-9]+]] : $Builtin.Int64): - // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable // let x - // CHECK-NEXT: debug_value [[YARG]] : $Builtin.Int64 // let y + // CHECK-NEXT: debug_value_addr [[XARG]] : $*Unloadable, let, name "x" + // CHECK-NEXT: debug_value [[YARG]] : $Builtin.Int64, let, name "y" // CHECK-NEXT: copy_addr [take] [[XARG]] to [initialization] [[RET]] // CHECK-NEXT: [[VOID:%[0-9]+]] = tuple () // CHECK-NEXT: return [[VOID]] @@ -64,8 +64,8 @@ func address_only_return(x: Unloadable, y: Int) -> Unloadable { // CHECK-LABEL: sil hidden @_TF18address_only_types27address_only_curried_return func address_only_curried_return(x: Unloadable)(y: Int) -> Unloadable { // CHECK: bb0([[RET:%[0-9]+]] : $*Unloadable, [[YARG:%[0-9]+]] : $Builtin.Int64, [[XADDR:%[0-9]+]] : $*Unloadable): - // CHECK-NEXT: debug_value [[YARG]] : $Builtin.Int64 // let y - // CHECK-NEXT: debug_value_addr [[XADDR]] : $*Unloadable // let x + // CHECK-NEXT: debug_value [[YARG]] : $Builtin.Int64, let, name "y" + // CHECK-NEXT: debug_value_addr [[XADDR]] : $*Unloadable, let, name "x" // CHECK-NEXT: copy_addr [take] [[XADDR]] to [initialization] [[RET]] // CHECK-NEXT: [[VOID:%[0-9]+]] = tuple () // CHECK-NEXT: return [[VOID]] diff --git a/test/SILGen/builtins.swift b/test/SILGen/builtins.swift index ffc4331560b..71532ff4a6b 100644 --- a/test/SILGen/builtins.swift +++ b/test/SILGen/builtins.swift @@ -547,7 +547,7 @@ func pinUnpin(object : Builtin.NativeObject) { // CHECK-LABEL: sil hidden @_TF8builtins19allocateValueBuffer // CHECK: bb0([[BUFFER:%.*]] : $*Builtin.UnsafeValueBuffer): -// CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer // var buffer, argno: 1 +// CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer, var, name "buffer", argno 1 // CHECK-NEXT: metatype $@thin Int.Type // CHECK-NEXT: [[T0:%.*]] = alloc_value_buffer $Int in [[BUFFER]] : $*Builtin.UnsafeValueBuffer // CHECK-NEXT: [[T1:%.*]] = address_to_pointer [[T0]] : $*Int to $Builtin.RawPointer @@ -558,7 +558,7 @@ func allocateValueBuffer(inout buffer: Builtin.UnsafeValueBuffer) -> Builtin.Raw // CHECK-LABEL: sil hidden @_TF8builtins18projectValueBuffer // CHECK: bb0([[BUFFER:%.*]] : $*Builtin.UnsafeValueBuffer): -// CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer // var buffer, argno: 1 +// CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer, var, name "buffer", argno 1 // CHECK-NEXT: metatype $@thin Int.Type // CHECK-NEXT: [[T0:%.*]] = project_value_buffer $Int in [[BUFFER]] : $*Builtin.UnsafeValueBuffer // CHECK-NEXT: [[T1:%.*]] = address_to_pointer [[T0]] : $*Int to $Builtin.RawPointer @@ -569,7 +569,7 @@ func projectValueBuffer(inout buffer: Builtin.UnsafeValueBuffer) -> Builtin.RawP // CHECK-LABEL: sil hidden @_TF8builtins18deallocValueBuffer // CHECK: bb0([[BUFFER:%.*]] : $*Builtin.UnsafeValueBuffer): -//CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer // var buffer, argno: 1 +//CHECK-NEXT: debug_value_addr %0 : $*Builtin.UnsafeValueBuffer, var, name "buffer", argno 1 // CHECK-NEXT: metatype $@thin Int.Type // CHECK-NEXT: dealloc_value_buffer $Int in [[BUFFER]] : $*Builtin.UnsafeValueBuffer // CHECK-NEXT: tuple () diff --git a/test/SILGen/closures.swift b/test/SILGen/closures.swift index 79949347bf3..cb8b9943336 100644 --- a/test/SILGen/closures.swift +++ b/test/SILGen/closures.swift @@ -239,7 +239,7 @@ func generateWithConstant(x : SomeSpecificClass) { } // CHECK-LABEL: sil shared @_TFF8closures20generateWithConstant // CHECK: bb0([[T0:%.*]] : $SomeSpecificClass): -// CHECK-NEXT: debug_value %0 : $SomeSpecificClass // let x, argno: 1 +// CHECK-NEXT: debug_value %0 : $SomeSpecificClass, let, name "x", argno 1 // CHECK-NEXT: [[T1:%.*]] = upcast [[T0]] : $SomeSpecificClass to $SomeClass // CHECK-NEXT: return [[T1]] @@ -303,7 +303,7 @@ func closeOverLetLValue() { // is loadable even though we capture the value. // CHECK-LABEL: sil shared @_TFF8closures18closeOverLetLValueFT_T_U_FT_Si // CHECK: bb0(%0 : $ClassWithIntProperty): -// CHECK-NEXT: [[TMP:%.*]] = alloc_stack $ClassWithIntProperty // let a, argno: 1 +// CHECK-NEXT: [[TMP:%.*]] = alloc_stack $ClassWithIntProperty, let, name "a", argno 1 // CHECK-NEXT: store %0 to [[TMP]]#1 : $*ClassWithIntProperty // CHECK-NEXT: {{.*}} = load [[TMP]]#1 : $*ClassWithIntProperty // CHECK-NEXT: {{.*}} = ref_element_addr {{.*}} : $ClassWithIntProperty, #ClassWithIntProperty.x @@ -331,7 +331,7 @@ struct StructWithMutatingMethod { // CHECK-LABEL: sil hidden @_TFV8closures24StructWithMutatingMethod14mutatingMethod // CHECK: bb0(%0 : $*StructWithMutatingMethod): -// CHECK-NEXT: %1 = alloc_box $StructWithMutatingMethod // var self, argno: 1 // users: %2, %5, %7, %8 +// CHECK-NEXT: %1 = alloc_box $StructWithMutatingMethod, var, name "self", argno 1 // users: %2, %5, %7, %8 // CHECK-NEXT: copy_addr %0 to [initialization] %1#1 : $*StructWithMutatingMethod // id: %2 // CHECK: [[CLOSURE:%[0-9]+]] = function_ref @_TFFV8closures24StructWithMutatingMethod14mutatingMethod{{.*}} : $@convention(thin) (@inout_aliasable StructWithMutatingMethod) -> Int // CHECK: partial_apply [[CLOSURE]](%1#1) : $@convention(thin) (@inout_aliasable StructWithMutatingMethod) -> Int diff --git a/test/SILGen/expressions.swift b/test/SILGen/expressions.swift index 1ea685a6139..bce9147cc1b 100644 --- a/test/SILGen/expressions.swift +++ b/test/SILGen/expressions.swift @@ -542,8 +542,8 @@ func implodeRecursiveTuple(expr: ((Int, Int), Int)?) { // CHECK-NEXT: [[WHOLE1:%[0-9]+]] = tuple_extract [[WHOLE]] : $((Int, Int), Int), 1 // CHECK-NEXT: [[X:%[0-9]+]] = tuple ([[WHOLE00]] : $Int, [[WHOLE01]] : $Int) - // CHECK-NEXT: debug_value [[X]] : $(Int, Int) // let x - // CHECK-NEXT: debug_value [[WHOLE1]] : $Int // let y + // CHECK-NEXT: debug_value [[X]] : $(Int, Int), let, name "x" + // CHECK-NEXT: debug_value [[WHOLE1]] : $Int, let, name "y" let (x, y) = expr! } diff --git a/test/SILGen/generic_tuples.swift b/test/SILGen/generic_tuples.swift index ee3ed83d89d..161be88a2dc 100644 --- a/test/SILGen/generic_tuples.swift +++ b/test/SILGen/generic_tuples.swift @@ -4,7 +4,7 @@ func dup(x: T) -> (T, T) { return (x,x) } // CHECK-LABEL: sil hidden @_TF14generic_tuples3dup // CHECK: ([[RESULT:%.*]] : $*(T, T), [[XVAR:%.*]] : $*T): -// CHECK-NEXT: debug_value_addr [[XVAR]] : $*T // let x +// CHECK-NEXT: debug_value_addr [[XVAR]] : $*T, let, name "x" // CHECK-NEXT: [[T0:%.*]] = tuple_element_addr [[RESULT]] : {{.*}}, 0 // CHECK-NEXT: [[T1:%.*]] = tuple_element_addr [[RESULT]] : {{.*}}, 1 // CHECK-NEXT: copy_addr [[XVAR]] to [initialization] [[T0]] diff --git a/test/SILGen/if_expr.swift b/test/SILGen/if_expr.swift index 8d01d7535f5..25c2bf2b1b0 100644 --- a/test/SILGen/if_expr.swift +++ b/test/SILGen/if_expr.swift @@ -32,9 +32,9 @@ func consumeAddressOnly(_: AddressOnly) {} // CHECK: sil hidden @_TF7if_expr19addr_only_ternary_1 func addr_only_ternary_1(x: Bool) -> AddressOnly { // CHECK: bb0([[RET:%.*]] : $*AddressOnly, {{.*}}): - // CHECK: [[a:%[0-9]+]] = alloc_box $AddressOnly // var a + // CHECK: [[a:%[0-9]+]] = alloc_box $AddressOnly, var, name "a" var a : AddressOnly = A() - // CHECK: [[b:%[0-9]+]] = alloc_box $AddressOnly // var b + // CHECK: [[b:%[0-9]+]] = alloc_box $AddressOnly, var, name "b" var b : AddressOnly = B() // CHECK: cond_br {{%.*}}, [[TRUE:bb[0-9]+]], [[FALSE:bb[0-9]+]] diff --git a/test/SILGen/if_while_binding.swift b/test/SILGen/if_while_binding.swift index 93829cccc16..edb7c14a1d7 100644 --- a/test/SILGen/if_while_binding.swift +++ b/test/SILGen/if_while_binding.swift @@ -37,7 +37,7 @@ func if_else_chain() { // CHECK: switch_enum [[XVAL]] : $Optional, case #Optional.Some!enumelt.1: [[YESX:bb[0-9]+]], default [[NOX:bb[0-9]+]] if let x = foo() { // CHECK: [[YESX]]([[XVAL:%[0-9]+]] : $String): - // CHECK: debug_value [[XVAL]] : $String // let x + // CHECK: debug_value [[XVAL]] : $String, let, name "x" // CHECK: [[A:%.*]] = function_ref @_TF16if_while_binding1aFSST_ // CHECK: retain_value [[XVAL]] // CHECK: apply [[A]]([[XVAL]]) @@ -102,7 +102,7 @@ func while_loop() { // CHECK-LABEL: sil hidden @_TF16if_while_binding18while_loop_generic // CHECK: br [[COND:bb[0-9]+]] // CHECK: [[COND]]: -// CHECK: [[X:%.*]] = alloc_stack $T // let x +// CHECK: [[X:%.*]] = alloc_stack $T, let, name "x" // CHECK: [[OPTBUF:%[0-9]+]] = alloc_stack $Optional // CHECK: switch_enum_addr {{.*}}, case #Optional.Some!enumelt.1: [[LOOPBODY:bb.*]], default [[OUT:bb[0-9]+]] // CHECK: [[OUT]]: @@ -130,7 +130,7 @@ func while_loop_multi() { // CHECK: switch_enum {{.*}}, case #Optional.Some!enumelt.1: [[CHECKBUF2:bb.*]], default [[LOOP_EXIT0:bb[0-9]+]] // CHECK: [[CHECKBUF2]]([[A:%[0-9]+]] : $String): - // CHECK: debug_value [[A]] : $String // let a + // CHECK: debug_value [[A]] : $String, let, name "a" // CHECK: switch_enum {{.*}}, case #Optional.Some!enumelt.1: [[LOOP_BODY:bb.*]], default [[LOOP_EXIT2a:bb[0-9]+]] @@ -140,8 +140,8 @@ func while_loop_multi() { // CHECK: [[LOOP_BODY]]([[B:%[0-9]+]] : $String): while let a = foo(), b = bar() { - // CHECK: debug_value [[B]] : $String // let b - // CHECK: debug_value [[A]] : $String // let c + // CHECK: debug_value [[B]] : $String, let, name "b" + // CHECK: debug_value [[A]] : $String, let, name "c" // CHECK: release_value [[B]] // CHECK: release_value [[A]] // CHECK: br [[LOOP_ENTRY]] @@ -262,7 +262,7 @@ func if_multi_where() { func if_leading_boolean(a : Int) { // Test the boolean condition. - // CHECK: debug_value %0 : $Int // let a + // CHECK: debug_value %0 : $Int, let, name "a" // CHECK: [[EQRESULT:%[0-9]+]] = apply {{.*}}(%0, %0) : $@convention(thin) (Int, Int) -> Bool // CHECK-NEXT: [[EQRESULTI1:%[0-9]+]] = apply %2([[EQRESULT]]) : $@convention(method) (Bool) -> Builtin.Int1 @@ -275,8 +275,8 @@ func if_leading_boolean(a : Int) { // CHECK: switch_enum [[OPTRESULT]] : $Optional, case #Optional.Some!enumelt.1: [[SUCCESS:bb.*]], default [[IF_DONE:bb[0-9]+]] // CHECK: [[SUCCESS]]([[B:%[0-9]+]] : $String): - // CHECK-NEXT: debug_value [[B:%[0-9]+]] : $String // let b - // CHECK-NEXT: debug_value [[B:%[0-9]+]] : $String // let c + // CHECK-NEXT: debug_value [[B:%[0-9]+]] : $String, let, name "b" + // CHECK-NEXT: debug_value [[B:%[0-9]+]] : $String, let, name "c" // CHECK-NEXT: release_value [[B]] // CHECK-NEXT: br [[IFDONE]] if a == a, let b = foo() { @@ -295,7 +295,7 @@ class DerivedClass : BaseClass {} // CHECK-LABEL: sil hidden @_TF16if_while_binding20testAsPatternInIfLetFGSqCS_9BaseClass_T_ func testAsPatternInIfLet(a : BaseClass?) { // CHECK: bb0(%0 : $Optional): - // CHECK-NEXT: debug_value %0 : $Optional // let a + // CHECK-NEXT: debug_value %0 : $Optional, let, name "a" // CHECK-NEXT: retain_value %0 : $Optional // CHECK-NEXT: switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: [[OPTPRESENTBB:bb[0-9]+]], default [[NILBB:bb[0-9]+]] diff --git a/test/SILGen/let_decls.swift b/test/SILGen/let_decls.swift index 2f8b581b01c..24b47efa81b 100644 --- a/test/SILGen/let_decls.swift +++ b/test/SILGen/let_decls.swift @@ -315,11 +315,11 @@ func testLetArchetypeBases(p : T) { // CHECK-LABEL: sil hidden @{{.*}}testDebugValue // CHECK: bb0(%0 : $Int, %1 : $*SimpleProtocol): -// CHECK-NEXT: debug_value %0 : $Int // let a -// CHECK-NEXT: debug_value_addr %1 : $*SimpleProtocol // let b +// CHECK-NEXT: debug_value %0 : $Int, let, name "a" +// CHECK-NEXT: debug_value_addr %1 : $*SimpleProtocol, let, name "b" func testDebugValue(a : Int, b : SimpleProtocol) -> Int { - // CHECK-NEXT: debug_value %0 : $Int // let x + // CHECK-NEXT: debug_value %0 : $Int, let, name "x" let x = a // CHECK: apply @@ -335,7 +335,7 @@ func testDebugValue(a : Int, b : SimpleProtocol) -> Int { // CHECK-LABEL: sil hidden @{{.*}}testAddressOnlyTupleArgument func testAddressOnlyTupleArgument(bounds: (start: SimpleProtocol, pastEnd: Int)) { // CHECK: bb0(%0 : $*SimpleProtocol, %1 : $Int): -// CHECK-NEXT: %2 = alloc_stack $(start: SimpleProtocol, pastEnd: Int) // let bounds +// CHECK-NEXT: %2 = alloc_stack $(start: SimpleProtocol, pastEnd: Int), let, name "bounds" // CHECK-NEXT: %3 = tuple_element_addr %2#1 : $*(start: SimpleProtocol, pastEnd: Int), 0 // CHECK-NEXT: copy_addr [take] %0 to [initialization] %3 : $*SimpleProtocol // CHECK-NEXT: %5 = tuple_element_addr %2#1 : $*(start: SimpleProtocol, pastEnd: Int), 1 @@ -389,7 +389,7 @@ struct StructMemberTest { } // CHECK-LABEL: sil hidden @{{.*}}testIntMemberLoad{{.*}} : $@convention(method) (@guaranteed StructMemberTest) // CHECK: bb0(%0 : $StructMemberTest): - // CHECK: debug_value %0 : $StructMemberTest // let self + // CHECK: debug_value %0 : $StructMemberTest, let, name "self" // CHECK: %2 = struct_extract %0 : $StructMemberTest, #StructMemberTest.i // CHECK-NOT: release_value %0 : $StructMemberTest // CHECK: return %2 : $Int @@ -400,7 +400,7 @@ struct StructMemberTest { } // CHECK-LABEL: sil hidden @{{.*}}testRecursiveIntMemberLoad{{.*}} : $@convention(method) (@guaranteed StructMemberTest) // CHECK: bb0(%0 : $StructMemberTest): - // CHECK: debug_value %0 : $StructMemberTest // let self + // CHECK: debug_value %0 : $StructMemberTest, let, name "self" // CHECK: %2 = struct_extract %0 : $StructMemberTest, #StructMemberTest.s // CHECK: %3 = struct_extract %2 : $AnotherStruct, #AnotherStruct.i // CHECK-NOT: release_value %0 : $StructMemberTest @@ -411,7 +411,7 @@ struct StructMemberTest { } // CHECK-LABEL: sil hidden @{{.*}}testTupleMemberLoad{{.*}} : $@convention(method) (@guaranteed StructMemberTest) // CHECK: bb0(%0 : $StructMemberTest): - // CHECK-NEXT: debug_value %0 : $StructMemberTest // let self + // CHECK-NEXT: debug_value %0 : $StructMemberTest, let, name "self" // CHECK-NEXT: [[T0:%.*]] = struct_extract %0 : $StructMemberTest, #StructMemberTest.t // CHECK-NEXT: [[T1:%.*]] = tuple_extract [[T0]] : $(Int, AnotherStruct), 0 // CHECK-NEXT: [[T2:%.*]] = tuple_extract [[T0]] : $(Int, AnotherStruct), 1 @@ -429,7 +429,7 @@ struct GenericStruct { } // CHECK-LABEL: sil hidden @{{.*}}GenericStruct4getA{{.*}} : $@convention(method) (@out T, @in_guaranteed GenericStruct) // CHECK: bb0(%0 : $*T, %1 : $*GenericStruct): - // CHECK-NEXT: debug_value_addr %1 : $*GenericStruct // let self + // CHECK-NEXT: debug_value_addr %1 : $*GenericStruct, let, name "self" // CHECK-NEXT: %3 = struct_element_addr %1 : $*GenericStruct, #GenericStruct.a // CHECK-NEXT: copy_addr %3 to [initialization] %0 : $*T // CHECK-NEXT: %5 = tuple () @@ -441,7 +441,7 @@ struct GenericStruct { // CHECK-LABEL: sil hidden @{{.*}}GenericStruct4getB{{.*}} : $@convention(method) (@in_guaranteed GenericStruct) -> Int // CHECK: bb0(%0 : $*GenericStruct): - // CHECK-NEXT: debug_value_addr %0 : $*GenericStruct // let self + // CHECK-NEXT: debug_value_addr %0 : $*GenericStruct, let, name "self" // CHECK-NEXT: %2 = struct_element_addr %0 : $*GenericStruct, #GenericStruct.b // CHECK-NEXT: %3 = load %2 : $*Int // CHECK-NOT: destroy_addr %0 : $*GenericStruct @@ -497,7 +497,7 @@ struct LetDeclInStruct { func test_unassigned_let_constant() { let string : String } -// CHECK: [[S:%[0-9]+]] = alloc_stack $String // let string +// CHECK: [[S:%[0-9]+]] = alloc_stack $String, let, name "string" // CHECK-NEXT: [[MUI:%[0-9]+]] = mark_uninitialized [var] [[S]]#1 : $*String // CHECK-NEXT: destroy_addr [[MUI]] : $*String // CHECK-NEXT: dealloc_stack [[S]]#0 : $*@local_storage String diff --git a/test/SILGen/metatypes.swift b/test/SILGen/metatypes.swift index d581a5aa840..08966efd16a 100644 --- a/test/SILGen/metatypes.swift +++ b/test/SILGen/metatypes.swift @@ -90,7 +90,7 @@ func existential_metatype_from_thin() -> Any.Type { // CHECK: [[T0:%.*]] = function_ref @_TFV9metatypes10SomeStructC // CHECK-NEXT: [[T1:%.*]] = metatype $@thin SomeStruct.Type // CHECK-NEXT: [[T2:%.*]] = apply [[T0]]([[T1]]) -// CHECK-NEXT: debug_value [[T2]] : $SomeStruct // let s +// CHECK-NEXT: debug_value [[T2]] : $SomeStruct, let, name "s" // CHECK-NEXT: [[T0:%.*]] = metatype $@thin SomeStruct.Type // CHECK-NEXT: [[T1:%.*]] = metatype $@thick SomeStruct.Type // CHECK-NEXT: [[T2:%.*]] = init_existential_metatype [[T1]] : $@thick SomeStruct.Type, $@thick Any.Type diff --git a/test/SILGen/objc_dealloc.swift b/test/SILGen/objc_dealloc.swift index 49a0aa1f744..80ca05c19a6 100644 --- a/test/SILGen/objc_dealloc.swift +++ b/test/SILGen/objc_dealloc.swift @@ -53,7 +53,7 @@ class SwiftGizmo : Gizmo { // Objective-C IVar initializer (i.e., -.cxx_construct) // CHECK-LABEL: sil hidden @_TToFC12objc_dealloc10SwiftGizmoe : $@convention(objc_method) (@owned SwiftGizmo) -> @owned SwiftGizmo // CHECK: bb0([[SELF_PARAM:%[0-9]+]] : $SwiftGizmo): - // CHECK-NEXT: debug_value [[SELF_PARAM]] : $SwiftGizmo // let self + // CHECK-NEXT: debug_value [[SELF_PARAM]] : $SwiftGizmo, let, name "self" // CHECK-NEXT: [[SELF:%[0-9]+]] = mark_uninitialized [rootself] [[SELF_PARAM]] : $SwiftGizmo // CHECK: [[XCTOR:%[0-9]+]] = function_ref @_TFC12objc_dealloc1XC // CHECK-NEXT: [[XMETA:%[0-9]+]] = metatype $@thick X.Type @@ -65,7 +65,7 @@ class SwiftGizmo : Gizmo { // Objective-C IVar destroyer (i.e., -.cxx_destruct) // CHECK-LABEL: sil hidden @_TToFC12objc_dealloc10SwiftGizmoE : $@convention(objc_method) (SwiftGizmo) -> () // CHECK: bb0([[SELF:%[0-9]+]] : $SwiftGizmo): - // CHECK-NEXT: debug_value [[SELF]] : $SwiftGizmo // let self + // CHECK-NEXT: debug_value [[SELF]] : $SwiftGizmo, let, name "self" // CHECK-NEXT: [[X:%[0-9]+]] = ref_element_addr [[SELF]] : $SwiftGizmo, #SwiftGizmo.x // CHECK-NEXT: destroy_addr [[X]] : $*X // CHECK-NEXT: [[RESULT:%[0-9]+]] = tuple () diff --git a/test/SILGen/optional-cast.swift b/test/SILGen/optional-cast.swift index 5caacee4a12..4eaa5f17daa 100644 --- a/test/SILGen/optional-cast.swift +++ b/test/SILGen/optional-cast.swift @@ -5,7 +5,7 @@ class B : A {} // CHECK-LABEL: sil hidden @_TF4main3foo -// CHECK: [[X:%.*]] = alloc_box $Optional // var x +// CHECK: [[X:%.*]] = alloc_box $Optional, var, name "x" // Check whether the temporary holds a value. // CHECK: [[T1:%.*]] = select_enum %0 // CHECK-NEXT: cond_br [[T1]], [[IS_PRESENT:bb.*]], [[NOT_PRESENT:bb[0-9]+]] @@ -40,7 +40,7 @@ func foo(y : A?) { } // CHECK-LABEL: sil hidden @_TF4main3bar -// CHECK: [[X:%.*]] = alloc_box $Optional>> // var x +// CHECK: [[X:%.*]] = alloc_box $Optional>>, var, name "x" // Check for Some(...) // CHECK-NEXT: retain_value %0 @@ -103,7 +103,7 @@ func bar(y : A????) { } // CHECK-LABEL: sil hidden @_TF4main3baz -// CHECK: [[X:%.*]] = alloc_box $Optional // var x +// CHECK: [[X:%.*]] = alloc_box $Optional, var, name "x" // CHECK-NEXT: retain_value %0 // CHECK: [[T1:%.*]] = select_enum %0 // CHECK: [[VAL:%.*]] = unchecked_enum_data %0 @@ -118,7 +118,7 @@ func baz(y : AnyObject?) { // CHECK-LABEL: sil hidden @_TF4main18opt_to_opt_trivialFGSqSi_GSQSi_ // CHECK: bb0(%0 : $Optional): -// CHECK-NEXT: debug_value %0 : $Optional // let x +// CHECK-NEXT: debug_value %0 : $Optional, let, name "x" // CHECK-NEXT: %2 = unchecked_trivial_bit_cast %0 : $Optional to $ImplicitlyUnwrappedOptional // CHECK-NEXT: return %2 : $ImplicitlyUnwrappedOptional // CHECK-NEXT:} @@ -128,7 +128,7 @@ func opt_to_opt_trivial(x: Int?) -> Int! { // CHECK-LABEL: sil hidden @_TF4main20opt_to_opt_referenceFGSQCS_1C_GSqS0__ // CHECK: bb0(%0 : $ImplicitlyUnwrappedOptional): -// CHECK-NEXT: debug_value %0 : $ImplicitlyUnwrappedOptional // let x +// CHECK-NEXT: debug_value %0 : $ImplicitlyUnwrappedOptional, let, name "x" // CHECK-NEXT: %2 = unchecked_ref_cast %0 : $ImplicitlyUnwrappedOptional to $Optional // CHECK-NEXT: return %2 : $Optional // CHECK-NEXT:} @@ -136,7 +136,7 @@ func opt_to_opt_reference(x : C!) -> C? { return x } // CHECK-LABEL: sil hidden @_TF4main22opt_to_opt_addressOnly // CHECK: bb0(%0 : $*Optional, %1 : $*ImplicitlyUnwrappedOptional): -// CHECK-NEXT: debug_value_addr %1 : $*ImplicitlyUnwrappedOptional // let x +// CHECK-NEXT: debug_value_addr %1 : $*ImplicitlyUnwrappedOptional, let, name "x" // CHECK-NEXT: %3 = unchecked_addr_cast %0 : $*Optional to $*ImplicitlyUnwrappedOptional // CHECK-NEXT: copy_addr [take] %1 to [initialization] %3 func opt_to_opt_addressOnly(x : T!) -> T? { return x } @@ -159,8 +159,8 @@ public struct TestAddressOnlyStruct { // CHECK-LABEL: sil hidden @_TF4main35testContextualInitOfNonAddrOnlyTypeFGSqSi_T_ // CHECK: bb0(%0 : $Optional): -// CHECK-NEXT: debug_value %0 : $Optional // let a -// CHECK-NEXT: %2 = alloc_box $ImplicitlyUnwrappedOptional // var x +// CHECK-NEXT: debug_value %0 : $Optional, let, name "a" +// CHECK-NEXT: %2 = alloc_box $ImplicitlyUnwrappedOptional, var, name "x" // CHECK-NEXT: %3 = unchecked_addr_cast %2#1 : $*ImplicitlyUnwrappedOptional to $*Optional // CHECK-NEXT: store %0 to %3 : $*Optional // CHECK-NEXT: strong_release %2#0 : $@box ImplicitlyUnwrappedOptional diff --git a/test/SILGen/optional.swift b/test/SILGen/optional.swift index 16d677af5ff..e93115338cc 100644 --- a/test/SILGen/optional.swift +++ b/test/SILGen/optional.swift @@ -29,10 +29,10 @@ func testAddrOnlyCallResult(f: (()->T)?) { } // CHECK-LABEL: sil hidden @{{.*}}testAddrOnlyCallResult{{.*}} : $@convention(thin) (@owned Optional<() -> T>) -> () // CHECK: bb0([[T0:%.*]] : $Optional<() -> T>): -// CHECK: [[F:%.*]] = alloc_box $Optional<() -> T> // var f +// CHECK: [[F:%.*]] = alloc_box $Optional<() -> T>, var, name "f" // CHECK-NEXT: retain_value [[T0]] // CHECK-NEXT: store [[T0]] to [[F]]#1 -// CHECK-NEXT: [[X:%.*]] = alloc_box $Optional // var x +// CHECK-NEXT: [[X:%.*]] = alloc_box $Optional, var, name "x" // CHECK-NEXT: [[TEMP:%.*]] = init_enum_data_addr [[X]] // Check whether 'f' holds a value. // CHECK: [[T1:%.*]] = select_enum_addr [[F]]#1 diff --git a/test/SILGen/properties.swift b/test/SILGen/properties.swift index 701ec296054..3b71942a54b 100644 --- a/test/SILGen/properties.swift +++ b/test/SILGen/properties.swift @@ -526,7 +526,7 @@ struct DidSetWillSetTests: ForceAccessors { // CHECK-NEXT: [[AADDR:%.*]] = struct_element_addr [[SELFBOX:%.*]]#1 : $*DidSetWillSetTests, #DidSetWillSetTests.a // CHECK-NEXT: [[OLDVAL:%.*]] = load [[AADDR]] : $*Int - // CHECK-NEXT: debug_value [[OLDVAL]] : $Int // let tmp + // CHECK-NEXT: debug_value [[OLDVAL]] : $Int, let, name "tmp" // CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.willset : Swift.Int // CHECK-NEXT: [[WILLSETFN:%.*]] = function_ref @_TFV10properties18DidSetWillSetTestsw1a @@ -668,9 +668,9 @@ func propertyWithDidSetTakingOldValue() { // CHECK: // properties.(propertyWithDidSetTakingOldValue () -> ()).(p #1).setter : Swift.Int // CHECK-NEXT: sil {{.*}} @_TFF10properties32propertyWithDidSetTakingOldValue // CHECK: bb0(%0 : $Int, %1 : $@box Int): -// CHECK-NEXT: debug_value %0 : $Int // let newValue, argno: 1 +// CHECK-NEXT: debug_value %0 : $Int, let, name "newValue", argno 1 // CHECK-NEXT: %3 = project_box %1 -// CHECK-NEXT: debug_value_addr %3 : $*Int // var p, argno: 2 +// CHECK-NEXT: debug_value_addr %3 : $*Int, var, name "p", argno 2 // CHECK-NEXT: %5 = load %3 : $*Int // CHECK-NEXT: debug_value %5 : $Int // CHECK-NEXT: assign %0 to %3 : $*Int @@ -998,7 +998,7 @@ struct MutatingGetterStruct { } // CHECK-LABEL: sil hidden @_TZFV10properties20MutatingGetterStruct4test - // CHECK: [[X:%.*]] = alloc_box $MutatingGetterStruct // var x + // CHECK: [[X:%.*]] = alloc_box $MutatingGetterStruct, var, name "x" // CHECK: store {{.*}} to [[X]]#1 : $*MutatingGetterStruct // CHECK: apply {{%.*}}([[X]]#1) : $@convention(method) (@inout MutatingGetterStruct) -> Int static func test() { diff --git a/test/SILGen/protocols.swift b/test/SILGen/protocols.swift index df85e2b8a86..f860a3135be 100644 --- a/test/SILGen/protocols.swift +++ b/test/SILGen/protocols.swift @@ -82,7 +82,7 @@ func use_subscript_archetype_lvalue_get(inout generic : } // CHECK-LABEL: sil hidden @{{.*}}use_subscript_archetype_lvalue_get // CHECK: bb0(%0 : $*T, %1 : $Int): -// CHECK: [[INOUTBOX:%[0-9]+]] = alloc_box $T // var generic +// CHECK: [[INOUTBOX:%[0-9]+]] = alloc_box $T, var, name "generic" // CHECK: [[GUARANTEEDSTACK:%[0-9]+]] = alloc_stack $T // CHECK: copy_addr [[INOUTBOX]]#1 to [initialization] // CHECK: [[METH:%[0-9]+]] = witness_method $T, #SubscriptableGetSet.subscript!getter.1 diff --git a/test/SILGen/sil_locations.swift b/test/SILGen/sil_locations.swift index 7c1131bd1e6..256cd9929d3 100644 --- a/test/SILGen/sil_locations.swift +++ b/test/SILGen/sil_locations.swift @@ -145,7 +145,7 @@ func testSwitch() { // CHECK: cond_br // var z: Int = 200 - // CHECK: [[VAR_Z:%[0-9]+]] = alloc_box $Int // {{.*}} line:[[@LINE-1]]:9 + // CHECK: [[VAR_Z:%[0-9]+]] = alloc_box $Int, var, name "z"{{.*}}line:[[@LINE-1]]:9 // CHECK: integer_literal $Builtin.Int2048, 200 // {{.*}} line:[[@LINE-2]]:18 x = z // CHECK: strong_release [[VAR_Z]]{{.*}} // {{.*}} line:[[@LINE-1]]:9:cleanup @@ -186,7 +186,7 @@ func testFor() { } // CHECK-LABEL: sil hidden @_TF13sil_locations7testForFT_T_ - // CHECK: [[VAR_Y_IN_FOR:%[0-9]+]] = alloc_box $Int // {{.*}} line:[[@LINE-10]]:9 + // CHECK: [[VAR_Y_IN_FOR:%[0-9]+]] = alloc_box $Int, var, name "y" // {{.*}} line:[[@LINE-10]]:9 // CHECK: integer_literal $Builtin.Int2048, 300 // {{.*}} line:[[@LINE-11]]:18 // CHECK: strong_release [[VAR_Y_IN_FOR]]#0 : $@box Int // CHECK: br bb{{.*}} // {{.*}} line:[[@LINE-10]]:7 diff --git a/test/SILGen/statements.swift b/test/SILGen/statements.swift index 4886350ecb0..afb88a622ad 100644 --- a/test/SILGen/statements.swift +++ b/test/SILGen/statements.swift @@ -564,12 +564,12 @@ func testRequireExprPattern(a : Int) { // CHECK-LABEL: sil hidden @_TF10statements20testRequireOptional1FGSqSi_Si // CHECK: bb0(%0 : $Optional): -// CHECK-NEXT: debug_value %0 : $Optional // let a +// CHECK-NEXT: debug_value %0 : $Optional, let, name "a" // CHECK-NEXT: switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: bb1, default bb2 func testRequireOptional1(a : Int?) -> Int { // CHECK: bb1(%3 : $Int): - // CHECK-NEXT: debug_value %3 : $Int // let t + // CHECK-NEXT: debug_value %3 : $Int, let, name "t" // CHECK-NEXT: return %3 : $Int guard let t = a else { abort() } @@ -583,14 +583,14 @@ func testRequireOptional1(a : Int?) -> Int { // CHECK-LABEL: sil hidden @_TF10statements20testRequireOptional2FGSqSS_SS // CHECK: bb0(%0 : $Optional): -// CHECK-NEXT: debug_value %0 : $Optional // let a +// CHECK-NEXT: debug_value %0 : $Optional, let, name "a" // CHECK-NEXT: retain_value %0 : $Optional // CHECK-NEXT: switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: bb1, default bb2 func testRequireOptional2(a : String?) -> String { guard let t = a else { abort() } // CHECK: bb1(%4 : $String): - // CHECK-NEXT: debug_value %4 : $String // let t + // CHECK-NEXT: debug_value %4 : $String, let, name "t" // CHECK-NEXT: release_value %0 : $Optional // CHECK-NEXT: return %4 : $String @@ -608,8 +608,8 @@ enum MyOpt { // CHECK-LABEL: sil hidden @_TF10statements28testAddressOnlyEnumInRequire // CHECK: bb0(%0 : $*T, %1 : $*MyOpt): -// CHECK-NEXT: debug_value_addr %1 : $*MyOpt // let a -// CHECK-NEXT: %3 = alloc_stack $T // let t +// CHECK-NEXT: debug_value_addr %1 : $*MyOpt, let, name "a" +// CHECK-NEXT: %3 = alloc_stack $T, let, name "t" // CHECK-NEXT: %4 = alloc_stack $MyOpt // CHECK-NEXT: copy_addr %1 to [initialization] %4#1 : $*MyOpt // CHECK-NEXT: switch_enum_addr %4#1 : $*MyOpt, case #MyOpt.Some!enumelt.1: bb2, default bb1 @@ -667,7 +667,7 @@ func test_as_pattern(y : BaseClass) -> DerivedClass { // CHECK: bb{{.*}}([[PTR:%[0-9]+]] : $DerivedClass): - // CHECK-NEXT: debug_value [[PTR]] : $DerivedClass // let result + // CHECK-NEXT: debug_value [[PTR]] : $DerivedClass, let, name "result" // CHECK-NEXT: strong_release %0 : $BaseClass // CHECK-NEXT: return [[PTR]] : $DerivedClass return result @@ -676,7 +676,7 @@ func test_as_pattern(y : BaseClass) -> DerivedClass { func let_else_tuple_binding(a : (Int, Int)?) -> Int { // CHECK: bb0(%0 : $Optional<(Int, Int)>): - // CHECK-NEXT: debug_value %0 : $Optional<(Int, Int)> // let a + // CHECK-NEXT: debug_value %0 : $Optional<(Int, Int)>, let, name "a" // CHECK-NEXT: switch_enum %0 : $Optional<(Int, Int)>, case #Optional.Some!enumelt.1: bb1, default bb2 guard let (x, y) = a else { } @@ -685,9 +685,9 @@ func let_else_tuple_binding(a : (Int, Int)?) -> Int { // CHECK: bb1(%3 : $(Int, Int)): // CHECK-NEXT: %4 = tuple_extract %3 : $(Int, Int), 0 - // CHECK-NEXT: debug_value %4 : $Int // let x + // CHECK-NEXT: debug_value %4 : $Int, let, name "x" // CHECK-NEXT: %6 = tuple_extract %3 : $(Int, Int), 1 - // CHECK-NEXT: debug_value %6 : $Int // let y + // CHECK-NEXT: debug_value %6 : $Int, let, name "y" // CHECK-NEXT: return %4 : $Int } diff --git a/test/SILGen/switch.swift b/test/SILGen/switch.swift index 2a738e8f5a9..e5ffc2451fb 100644 --- a/test/SILGen/switch.swift +++ b/test/SILGen/switch.swift @@ -1236,14 +1236,14 @@ func testOptionalPattern(value : Int?) { // switch on the enum kind. There should be no unreachable generated. // CHECK-LABEL: sil hidden @_TF6switch19testOptionalEnumMixFGSqSi_Si func testOptionalEnumMix(a : Int?) -> Int { - // CHECK: debug_value %0 : $Optional // let a + // CHECK: debug_value %0 : $Optional, let, name "a" // CHECK-NEXT: switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: [[SOMEBB:bb[0-9]+]], case #Optional.None!enumelt: [[NILBB:bb[0-9]+]] switch a { case let x?: return 0 // CHECK: [[SOMEBB]](%3 : $Int): - // CHECK-NEXT: debug_value %3 : $Int // let x + // CHECK-NEXT: debug_value %3 : $Int, let, name "x" // CHECK: integer_literal $Builtin.Int2048, 0 case .None: @@ -1258,14 +1258,14 @@ func testOptionalEnumMix(a : Int?) -> Int { // switch on the enum kind. There should be no unreachable generated. // CHECK-LABEL: sil hidden @_TF6switch26testOptionalEnumMixWithNilFGSqSi_Si func testOptionalEnumMixWithNil(a : Int?) -> Int { - // CHECK: debug_value %0 : $Optional // let a + // CHECK: debug_value %0 : $Optional, let, name "a" // CHECK-NEXT: switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: [[SOMEBB:bb[0-9]+]], case #Optional.None!enumelt: [[NILBB:bb[0-9]+]] switch a { case let x?: return 0 // CHECK: [[SOMEBB]](%3 : $Int): - // CHECK-NEXT: debug_value %3 : $Int // let x + // CHECK-NEXT: debug_value %3 : $Int, let, name "x" // CHECK: integer_literal $Builtin.Int2048, 0 case nil: diff --git a/test/SILGen/unmanaged.swift b/test/SILGen/unmanaged.swift index 55ccdf62904..ba499e1d7ce 100644 --- a/test/SILGen/unmanaged.swift +++ b/test/SILGen/unmanaged.swift @@ -32,7 +32,7 @@ func get(inout holder holder: Holder) -> C { } // CHECK-LABEL:sil hidden @_TF9unmanaged3getFT6holderRVS_6Holder_CS_1C : $@convention(thin) (@inout Holder) -> @owned C // CHECK: bb0([[ADDR:%.*]] : $*Holder): -// CHECK-NEXT: debug_value_addr %0 : $*Holder // var holder, argno: 1 +// CHECK-NEXT: debug_value_addr %0 : $*Holder, var, name "holder", argno 1 // CHECK-NEXT: [[T0:%.*]] = struct_element_addr [[ADDR]] : $*Holder, #Holder.value // CHECK-NEXT: [[T1:%.*]] = load [[T0]] : $*@sil_unmanaged C // CHECK-NEXT: [[T2:%.*]] = unmanaged_to_ref [[T1]] diff --git a/test/SILGen/unowned.swift b/test/SILGen/unowned.swift index f25c369024c..209635d4a41 100644 --- a/test/SILGen/unowned.swift +++ b/test/SILGen/unowned.swift @@ -72,7 +72,7 @@ func unowned_local() -> C { // CHECK: [[c:%.*]] = apply let c = C() - // CHECK: [[uc:%.*]] = alloc_box $@sil_unowned C // let uc + // CHECK: [[uc:%.*]] = alloc_box $@sil_unowned C, let, name "uc" // CHECK-NEXT: [[tmp1:%.*]] = ref_to_unowned [[c]] : $C to $@sil_unowned C // CHECK-NEXT: unowned_retain [[tmp1]] // CHECK-NEXT: store [[tmp1]] to [[uc]]#1 @@ -96,7 +96,7 @@ func test_unowned_let_capture(aC : C) { // CHECK-LABEL: sil shared @_TFF7unowned24test_unowned_let_captureFCS_1CT_U_FT_Si : $@convention(thin) (@owned @sil_unowned C) -> Int { // CHECK: bb0([[ARG:%.*]] : $@sil_unowned C): -// CHECK-NEXT: debug_value %0 : $@sil_unowned C // let bC, argno: 1 +// CHECK-NEXT: debug_value %0 : $@sil_unowned C, let, name "bC", argno 1 // CHECK-NEXT: strong_retain_unowned [[ARG]] : $@sil_unowned C // CHECK-NEXT: [[UNOWNED_ARG:%.*]] = unowned_to_ref [[ARG]] : $@sil_unowned C to $C // CHECK-NEXT: [[FUN:%.*]] = class_method [[UNOWNED_ARG]] : $C, #C.f!1 : C -> () -> Int , $@convention(method) (@guaranteed C) -> Int diff --git a/test/SILGen/weak.swift b/test/SILGen/weak.swift index 226282711b7..8403adc35fd 100644 --- a/test/SILGen/weak.swift +++ b/test/SILGen/weak.swift @@ -21,7 +21,7 @@ func test0(c c: C) { // CHECK: [[A:%.*]] = mark_uninitialized [var] [[A1]]#1 weak var x = c -// CHECK: [[X:%.*]] = alloc_box $@sil_weak Optional // var x +// CHECK: [[X:%.*]] = alloc_box $@sil_weak Optional, var, name "x" // Implicit conversion // CHECK-NEXT: [[TMP:%.*]] = load [[C]]#1 : $*C // CHECK-NEXT: strong_retain [[TMP]] : $C @@ -48,7 +48,7 @@ func test0(c c: C) { // CHECK-LABEL: sil shared @_TFF4weak19testClosureOverWeakFT_T_U_FT_Si : $@convention(thin) (@owned @box @sil_weak Optional) -> Int { // CHECK: bb0(%0 : $@box @sil_weak Optional): // CHECK-NEXT: %1 = project_box %0 -// CHECK-NEXT: debug_value_addr %1 : $*@sil_weak Optional // var bC, argno: 1 +// CHECK-NEXT: debug_value_addr %1 : $*@sil_weak Optional, var, name "bC", argno 1 // CHECK-NEXT: %3 = alloc_stack $Optional // CHECK-NEXT: %4 = load_weak %1 : $*@sil_weak Optional // CHECK-NEXT: store %4 to %3#1 : $*Optional diff --git a/test/SILOptimizer/allocbox_to_stack.sil b/test/SILOptimizer/allocbox_to_stack.sil index 530d225130e..59181b8654a 100644 --- a/test/SILOptimizer/allocbox_to_stack.sil +++ b/test/SILOptimizer/allocbox_to_stack.sil @@ -314,7 +314,7 @@ bb3: // struct.apply (f : () -> Swift.Int) -> Swift.Int sil @_TF6struct5applyFT1fFT_Si_Si : $@convention(thin) (@owned @callee_owned () -> Int) -> Int { bb0(%0 : $@callee_owned () -> Int): - debug_value %0 : $@callee_owned () -> Int // let f // id: %1 + debug_value %0 : $@callee_owned () -> Int, let, name "f" // id: %1 strong_retain %0 : $@callee_owned () -> Int // id: %2 %3 = apply %0() : $@callee_owned () -> Int // user: %5 strong_release %0 : $@callee_owned () -> Int // id: %4 @@ -325,7 +325,7 @@ bb0(%0 : $@callee_owned () -> Int): // struct.escape (f : () -> Swift.Int) -> () -> Swift.Int sil @_TF6struct6escapeFT1fFT_Si_FT_Si : $@convention(thin) (@owned @callee_owned () -> Int) -> @owned @callee_owned () -> Int { bb0(%0 : $@callee_owned () -> Int): - debug_value %0 : $@callee_owned () -> Int // let f // id: %1 + debug_value %0 : $@callee_owned () -> Int, let, name "f" // id: %1 return %0 : $@callee_owned () -> Int // id: %2 } @@ -333,9 +333,9 @@ bb0(%0 : $@callee_owned () -> Int): // struct.useStack (t : Swift.Int) -> () sil @_TF6struct8useStackFT1tSi_T_ : $@convention(thin) (Int) -> () { bb0(%0 : $Int): - debug_value %0 : $Int // let t // id: %1 + debug_value %0 : $Int, let, name "t" // id: %1 // CHECK: alloc_stack - %2 = alloc_box $Int // var s // users: %3, %6, %7, %7, %9 + %2 = alloc_box $Int, var, name "s" // users: %3, %6, %7, %7, %9 store %0 to %2#1 : $*Int // id: %3 // function_ref struct.apply (f : () -> Swift.Int) -> Swift.Int %4 = function_ref @_TF6struct5applyFT1fFT_Si_Si : $@convention(thin) (@owned @callee_owned () -> Int) -> Int // user: %8 @@ -374,9 +374,9 @@ sil [transparent] @_TFsoP2ppUs14_Incrementable__FT1xRQ__Q_ : $@convention(thin) // struct.useBox (t : Swift.Int) -> () sil @_TF6struct6useBoxFT1tSi_T_ : $@convention(thin) (Int) -> () { bb0(%0 : $Int): - debug_value %0 : $Int // let t // id: %1 + debug_value %0 : $Int, let, name "t" // id: %1 // CHECK: alloc_box - %2 = alloc_box $Int // var s // users: %3, %6, %7, %7, %10 + %2 = alloc_box $Int, var, name "s" // users: %3, %6, %7, %7, %10 store %0 to %2#1 : $*Int // id: %3 // function_ref struct.escape (f : () -> Swift.Int) -> () -> Swift.Int %4 = function_ref @_TF6struct6escapeFT1fFT_Si_FT_Si : $@convention(thin) (@owned @callee_owned () -> Int) -> @owned @callee_owned () -> Int // user: %8 diff --git a/test/SILOptimizer/closure_specialize.sil b/test/SILOptimizer/closure_specialize.sil index 2e8d9c985b9..6c8629b1f32 100644 --- a/test/SILOptimizer/closure_specialize.sil +++ b/test/SILOptimizer/closure_specialize.sil @@ -78,9 +78,9 @@ bb0(%0 : $Int): // CHECK-LABEL: sil shared @_TFF7specgen6callerFSiT_U_FTSiSi_T_ : $@convention(thin) (Int, Int, Int) -> () { sil shared @_TFF7specgen6callerFSiT_U_FTSiSi_T_ : $@convention(thin) (Int, Int, Int) -> () { bb0(%0 : $Int, %1 : $Int, %2 : $Int): - %5 = alloc_box $Int // var p // users: %6, %10, %14 + %5 = alloc_box $Int, var, name "p" // users: %6, %10, %14 store %0 to %5#1 : $*Int // id: %6 - %7 = alloc_box $Int // var q // users: %8, %11, %13 + %7 = alloc_box $Int, var, name "q" // users: %8, %11, %13 store %1 to %7#1 : $*Int // id: %8 // function_ref specgen.callee (Swift.Int, Swift.Int, Swift.Int) -> () %9 = function_ref @_TF7specgen6calleeFTSiSiSi_T_ : $@convention(thin) (Int, Int, Int) -> () // user: %12 diff --git a/test/SILOptimizer/copyforward.sil b/test/SILOptimizer/copyforward.sil index 68307cf4d8a..16cbfe81f87 100644 --- a/test/SILOptimizer/copyforward.sil +++ b/test/SILOptimizer/copyforward.sil @@ -20,7 +20,7 @@ protocol P { // CHECK: return sil hidden @nrvo : $@convention(thin) (@out T, Bool) -> () { bb0(%0 : $*T, %1 : $Bool): - %2 = alloc_stack $T // var rvo // users: %9, %15, %17, %19 + %2 = alloc_stack $T, var, name "ro" // users: %9, %15, %17, %19 debug_value_addr %0 : $*T debug_value_addr %2#1 : $*T %3 = struct_extract %1 : $Bool, #Bool._value // user: %4 @@ -236,7 +236,7 @@ sil [transparent] @_TFO8enuminit1A3ValU__fMGS0_Q__FQ_GS0_Q__ : $@convention(thin //CHECK: return sil @enuminit : $@convention(thin) (@out A, @in T, @thin A.Type) -> () { bb0(%0 : $*A, %1 : $*T, %2 : $@thin A.Type): - %3 = alloc_stack $A // var self // users: %10, %14, %16 + %3 = alloc_stack $A, var, name "sf" // users: %10, %14, %16 // function_ref enuminit.A.Val (enuminit.A.Type)(A) -> enuminit.A %4 = function_ref @_TFO8enuminit1A3ValU__fMGS0_Q__FQ_GS0_Q__ : $@convention(thin) <τ_0_0> (@out A<τ_0_0>, @in τ_0_0, @thin A<τ_0_0>.Type) -> () // user: %9 %5 = metatype $@thin A.Type // user: %9 @@ -259,7 +259,7 @@ bb0(%0 : $*A, %1 : $*T, %2 : $@thin A.Type): //CHECK: return sil hidden @make_addronly : $@convention(thin) (@out T) -> () { bb0(%0 : $*T): - %1 = alloc_stack $T // let t // users: %3, %4, %5 + %1 = alloc_stack $T, let, name "t" // users: %3, %4, %5 %2 = function_ref @f_out : $@convention(thin) <τ_0_0> (@out τ_0_0) -> () // user: %3 %3 = apply %2(%1#1) : $@convention(thin) <τ_0_0> (@out τ_0_0) -> () copy_addr [take] %1#1 to [initialization] %0 : $*T // id: %4 diff --git a/test/SILOptimizer/cse.sil b/test/SILOptimizer/cse.sil index bba6053a452..edef6e50b52 100644 --- a/test/SILOptimizer/cse.sil +++ b/test/SILOptimizer/cse.sil @@ -1096,7 +1096,7 @@ func foo(x: T, a: Int) // p.T.reach (p.T)() -> () sil hidden @_TFC1p1T5reachfS0_FT_T_ : $@convention(method) (@guaranteed T) -> () { bb0(%0 : $T): - debug_value %0 : $T // let self // id: %1 + debug_value %0 : $T, let, name "self" // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } @@ -1104,7 +1104,7 @@ bb0(%0 : $T): // p.T.__deallocating_deinit sil hidden @_TFC1p1TD : $@convention(method) (@owned T) -> () { bb0(%0 : $T): - debug_value %0 : $T // let self // id: %1 + debug_value %0 : $T, let, name "self" // id: %1 %6 = tuple () // user: %7 return %6 : $() // id: %7 } @@ -1112,7 +1112,7 @@ bb0(%0 : $T): // p.T.deinit sil hidden @_TFC1p1Td : $@convention(method) (@guaranteed T) -> @owned Builtin.NativeObject { bb0(%0 : $T): - debug_value %0 : $T // let self // id: %1 + debug_value %0 : $T, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $T to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } @@ -1120,7 +1120,7 @@ bb0(%0 : $T): // p.T.init (p.T.Type)() -> p.T sil hidden @_TFC1p1TcfMS0_FT_S0_ : $@convention(method) (@owned T) -> @owned T { bb0(%0 : $T): - debug_value %0 : $T // let self // id: %1 + debug_value %0 : $T, let, name "self" // id: %1 return %0 : $T // id: %2 } @@ -1191,7 +1191,7 @@ func trytofly(a: Flyable) // p2.Airplane.fly (p2.Airplane)() -> () sil hidden @_TFV2p28Airplane3flyfS0_FT_T_ : $@convention(method) (Airplane) -> () { bb0(%0 : $Airplane): - debug_value %0 : $Airplane // let self // id: %1 + debug_value %0 : $Airplane, let, name "self" // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } @@ -1262,7 +1262,7 @@ func trytowalk(f: Walkable) // test.Bar.init (test.Bar.Type)() -> test.Bar sil hidden @_TFC4test3BarcfMS0_FT_S0_ : $@convention(method) (@owned Bar) -> @owned Bar { bb0(%0 : $Bar): - %1 = alloc_stack $Bar // let self // users: %2, %6, %9, %10 + %1 = alloc_stack $Bar, let, name "sf" // users: %2, %6, %9, %10 store %0 to %1#1 : $*Bar // id: %2 %3 = upcast %0 : $Bar to $NSObject // user: %7 %4 = super_method [volatile] %0 : $Bar, #NSObject.init!initializer.1.foreign : NSObject.Type -> () -> NSObject , $@convention(objc_method) (@owned NSObject) -> @owned NSObject // user: %7 @@ -1295,7 +1295,7 @@ bb0(%0 : $Bar): // test.Bar.walk (test.Bar)() -> () sil hidden @_TFC4test3Bar4walkfS0_FT_T_ : $@convention(method) (@guaranteed Bar) -> () { bb0(%0 : $Bar): - debug_value %0 : $Bar // let self // id: %1 + debug_value %0 : $Bar, let, name "self" // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } @@ -1314,7 +1314,7 @@ bb0(%0 : $Bar): // test.Bar.__deallocating_deinit sil hidden @_TFC4test3BarD : $@convention(method) (@owned Bar) -> () { bb0(%0 : $Bar): - debug_value %0 : $Bar // let self // id: %1 + debug_value %0 : $Bar, let, name "self" // id: %1 %2 = super_method %0 : $Bar, #NSObject.deinit!deallocator.foreign : NSObject -> () , $@convention(objc_method) (NSObject) -> () // user: %4 %3 = upcast %0 : $Bar to $NSObject // user: %4 %4 = apply %2(%3) : $@convention(objc_method) (NSObject) -> () diff --git a/test/SILOptimizer/cse_apply.sil b/test/SILOptimizer/cse_apply.sil index e872d542e36..9100a9ae6a5 100644 --- a/test/SILOptimizer/cse_apply.sil +++ b/test/SILOptimizer/cse_apply.sil @@ -18,8 +18,8 @@ import Swift //CHECK: return sil @simply_arith : $@convention(thin) (Int32, Int32) -> Int32 { bb0(%0 : $Int32, %1 : $Int32): - debug_value %0 : $Int32 // let x // id: %2 - debug_value %1 : $Int32 // let y // id: %3 + debug_value %0 : $Int32, let, name "x" // id: %2 + debug_value %1 : $Int32, let, name "y" // id: %3 %5 = struct_extract %0 : $Int32, #Int32._value // user: %8 %6 = struct_extract %1 : $Int32, #Int32._value // user: %8 %7 = integer_literal $Builtin.Int1, -1 // user: %8 diff --git a/test/SILOptimizer/deadstoreelimination.sil b/test/SILOptimizer/deadstoreelimination.sil index e992b9ab42d..374eb84e252 100644 --- a/test/SILOptimizer/deadstoreelimination.sil +++ b/test/SILOptimizer/deadstoreelimination.sil @@ -140,7 +140,7 @@ sil @escaped_a : $@convention(thin) () -> Builtin.RawPointer // DISABLECHECK: return sil hidden @DeadLocalStoreSimpleStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $Int // var a // users: %3, %5 + %0 = alloc_stack $Int, var, name "a" // users: %3, %5 %1 = integer_literal $Builtin.Int64, 1 // user: %2 %2 = struct $Int (%1 : $Builtin.Int64) // user: %3 store %2 to %0#1 : $*Int // id: %3 @@ -161,7 +161,7 @@ bb0: // DISABLECHECK: return sil hidden @NoDeadLocalStoreSimpleStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $Int // var a // users: %3, %5 + %0 = alloc_stack $Int, var, name "a" // users: %3, %5 %1 = integer_literal $Builtin.Int64, 1 // user: %2 %2 = struct $Int (%1 : $Builtin.Int64) // user: %3 store %2 to %0#1 : $*Int // id: %3 @@ -185,7 +185,7 @@ bb0: // DISABLECHECK: debug_value_addr sil hidden @NoDeadStoreDebugValueAddr : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $Int // var a // users: %3, %5 + %0 = alloc_stack $Int, var, name "a" // users: %3, %5 %1 = integer_literal $Builtin.Int64, 1 // user: %2 %2 = struct $Int (%1 : $Builtin.Int64) // user: %3 store %2 to %0#1 : $*Int // id: %3 @@ -762,7 +762,7 @@ bb4: // Preds: bb2 bb3 // CHECK: br sil hidden @DeadStoreSingleLoopBlockSimpleStruct : $@convention(thin) (Bool, Int) -> () { bb0(%0 : $Bool, %1 : $Int): - %2 = alloc_stack $S1 // var x // users: %8, %13, %18, %23, %26 + %2 = alloc_stack $S1, var, name "x" // users: %8, %13, %18, %23, %26 %5 = function_ref @S1_init : $@convention(thin) (@thin S1.Type) -> S1 // user: %7 %6 = metatype $@thin S1.Type // user: %7 %7 = apply %5(%6) : $@convention(thin) (@thin S1.Type) -> S1 // user: %8 @@ -805,7 +805,7 @@ bb3: // Preds: bb1 bb2 // CHECK: br sil hidden @DeadStoreInMultiLoopBlocksSimpleStruct : $@convention(thin) (Bool, Int) -> () { bb0(%0 : $Bool, %1 : $Int): - %2 = alloc_stack $S1 // var x // users: %8, %13, %18, %23, %26 + %2 = alloc_stack $S1, var, name "x" // users: %8, %13, %18, %23, %26 %5 = function_ref @S1_init : $@convention(thin) (@thin S1.Type) -> S1 // user: %7 %6 = metatype $@thin S1.Type // user: %7 %7 = apply %5(%6) : $@convention(thin) (@thin S1.Type) -> S1 // user: %8 @@ -852,7 +852,7 @@ bb3: // Preds: bb1 bb2 // CHECK-NEXT: store sil hidden @DeadStoreInSimpleTuple : $@convention(thin) () -> Int { bb0: - %0 = alloc_stack $(a: Int, b: Int) // var x // users: %1, %2, %11, %15, %20 + %0 = alloc_stack $(a: Int, b: Int), var, name "x" // users: %1, %2, %11, %15, %20 %1 = tuple_element_addr %0#1 : $*(a: Int, b: Int), 0 // user: %5 %2 = tuple_element_addr %0#1 : $*(a: Int, b: Int), 1 // user: %8 %3 = integer_literal $Builtin.Int64, 2 // user: %4 @@ -1123,7 +1123,7 @@ bb0(%0 : $*A): // CHECK: return sil hidden @DeadStoreEnumSameCase : $@convention(thin) () -> Int64 { bb0: - %0 = alloc_stack $Example // var x // users: %7, %14, %19 + %0 = alloc_stack $Example, var, name "x" // users: %7, %14, %19 %1 = integer_literal $Builtin.Int64, 64 // user: %2 %2 = struct $Int64 (%1 : $Builtin.Int64) // user: %5 %3 = integer_literal $Builtin.Int64, 64 // user: %4 @@ -1195,7 +1195,7 @@ bb3: // Preds: bb1 bb2 /// CHECK: store [[RET0:%.+]] to [[RET1:%.+]] : $*S4 sil hidden @PartialDeadStoreStructInStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S5 // var i // users: %4, %7, %10 + %0 = alloc_stack $S5, var, name "i" // users: %4, %7, %10 %1 = function_ref @S5_init : $@convention(thin) (@thin S5.Type) -> S5 // user: %3 %2 = metatype $@thin S5.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S5.Type) -> S5 // user: %4 @@ -1217,7 +1217,7 @@ bb0: /// CHECK: store sil hidden @DiscontiguosPartialDeadStoreInSimpleStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S6 // var a // users: %4, %7, %10 + %0 = alloc_stack $S6, var, name "a" // users: %4, %7, %10 %1 = function_ref @S6_init : $@convention(thin) (@thin S6.Type) -> S6 // user: %3 %2 = metatype $@thin S6.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S6.Type) -> S6 // user: %4 @@ -1240,7 +1240,7 @@ bb0: /// CHECK: store sil hidden @DiscontiguosPartialDeadStoreInSimpleLargeStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S7 // var a // users: %4, %7, %10 + %0 = alloc_stack $S7, var, name "a" // users: %4, %7, %10 %1 = function_ref @S7_init : $@convention(thin) (@thin S7.Type) -> S7 // user: %3 %2 = metatype $@thin S7.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S7.Type) -> S7 // user: %4 @@ -1264,7 +1264,7 @@ bb0: /// CHECK: function_ref sil hidden @PartialDeadStoreBailOutProperPropagation : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S7 // var a // users: %4, %7, %10 + %0 = alloc_stack $S7, var, name "a" // users: %4, %7, %10 %55 = integer_literal $Builtin.Int64, 10 // user: %6 %56 = struct $Int (%55 : $Builtin.Int64) // user: %8 %57 = struct_element_addr %0#1 : $*S7, #S7.a // user: %8 @@ -1293,7 +1293,7 @@ bb0: /// CHECK-NEXT: struct_extract sil hidden @PartialDeadStoreInSimpleSmallStruct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S3 // var a // users: %4, %7, %10 + %0 = alloc_stack $S3, var, name "a" // users: %4, %7, %10 %1 = function_ref @S3_init : $@convention(thin) (@thin S3.Type) -> S3 // user: %3 %2 = metatype $@thin S3.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S3.Type) -> S3 // user: %4 @@ -1317,7 +1317,7 @@ bb0: /// CHECK-NEXT: store [[RET0:%.+]] to [[RET1:%.+]] : $*SelfLoop sil hidden @SelfLoopClassTestTypeExpansion : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S8 // var h // users: %4, %7, %13 + %0 = alloc_stack $S8, var, name "h" // users: %4, %7, %13 %1 = function_ref @S8_init : $@convention(thin) (@thin S8.Type) -> @owned S8 // user: %3 %2 = metatype $@thin S8.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S8.Type) -> @owned S8 // users: %4, %9 @@ -1343,8 +1343,8 @@ bb0: /// CHECK: store sil hidden @NoDeadStoreWithInterferingLoad : $@convention(thin) (@owned foo, @owned foo) -> () { bb0(%0 : $foo, %1 : $foo): - debug_value %0 : $foo // let x // id: %2 - debug_value %1 : $foo // let a // id: %3 + debug_value %0 : $foo, let, name "x" // id: %2 + debug_value %1 : $foo, let, name "a" // id: %3 %4 = integer_literal $Builtin.Int64, 10 // user: %5 %5 = struct $Int (%4 : $Builtin.Int64) // user: %7 %6 = ref_element_addr %0 : $foo, #foo.a // user: %7 diff --git a/test/SILOptimizer/definite_init.sil b/test/SILOptimizer/definite_init.sil index 45dab710826..4c93c8cee18 100644 --- a/test/SILOptimizer/definite_init.sil +++ b/test/SILOptimizer/definite_init.sil @@ -671,9 +671,9 @@ struct MyStruct : P {} //CHECK: return sil @self_init_assert_instruction : $@convention(thin) (Int, @thin MyStruct.Type) -> MyStruct { bb0(%0 : $Int, %1 : $@thin MyStruct.Type): - %2 = alloc_stack $MyStruct // var self // users: %3, %10 + %2 = alloc_stack $MyStruct, var, name "sf" // users: %3, %10 %3 = mark_uninitialized [delegatingself] %2#1 : $*MyStruct // users: %8, %9 - debug_value %0 : $Int // let i // id: %4 + debug_value %0 : $Int, let, name "i" // id: %4 %6 = function_ref @selfinit : $@convention(thin) () -> MyStruct %7 = apply %6() : $@convention(thin) () -> MyStruct @@ -698,7 +698,7 @@ sil @selfinit_delegate : $@convention(thin) (@out MyStruct2, @thin MyStruct2.Typ sil @self_init_copyaddr : $@convention(thin) (@out MyStruct2, @thin MyStruct2.Type) -> () { bb0(%0 : $*MyStruct2, %1 : $@thin MyStruct2.Type): // CHECK: [[SELF:%[0-9]+]] = alloc_stack $MyStruct2 - %2 = alloc_stack $MyStruct2 // var self + %2 = alloc_stack $MyStruct2, var, name "sf" %3 = mark_uninitialized [delegatingself] %2#1 : $*MyStruct2 %6 = metatype $@thin MyStruct2.Type %7 = function_ref @selfinit_delegate : $@convention(thin) (@out MyStruct2, @thin MyStruct2.Type) -> () diff --git a/test/SILOptimizer/devirt_access.sil b/test/SILOptimizer/devirt_access.sil index 25ded4188da..93c8f864a72 100644 --- a/test/SILOptimizer/devirt_access.sil +++ b/test/SILOptimizer/devirt_access.sil @@ -92,7 +92,7 @@ sil @_TFC14devirt_access21BCfMS0_FT_S0_ : $@convention(thin) (@thick B.Type) -> //CHECK: return sil @Case1 : $@convention(thin) (@owned X) -> Int { bb0(%0 : $X): - debug_value %0 : $X // let a // id: %1 + debug_value %0 : $X, let, name "a" // id: %1 strong_retain %0 : $X // id: %2 %3 = class_method %0 : $X, #X.ping!1 : X -> () -> Int , $@convention(method) (@guaranteed X) -> Int // user: %4 %4 = apply %3(%0) : $@convention(method) (@guaranteed X) -> Int // user: %6 @@ -110,7 +110,7 @@ bb0(%0 : $X): //CHECK: return sil @Case2 : $@convention(thin) (@owned Y) -> Int { bb0(%0 : $Y): - debug_value %0 : $Y // let a // id: %1 + debug_value %0 : $Y, let, name "a" // id: %1 strong_retain %0 : $Y // id: %2 %3 = upcast %0 : $Y to $X // users: %4, %5 %4 = class_method %3 : $X, #X.ping!1 : X -> () -> Int , $@convention(method) (@guaranteed X) -> Int // user: %5 @@ -124,7 +124,7 @@ bb0(%0 : $Y): //CHECK: return sil @Case3 : $@convention(thin) (@owned A) -> Int { bb0(%0 : $A): - debug_value %0 : $A // let a // id: %1 + debug_value %0 : $A, let, name "a" // id: %1 strong_retain %0 : $A // id: %2 %3 = class_method %0 : $A, #A.ping!1 : A -> () -> Int , $@convention(method) (@guaranteed A) -> Int // user: %4 %4 = apply %3(%0) : $@convention(method) (@guaranteed A) -> Int // user: %6 @@ -137,7 +137,7 @@ bb0(%0 : $A): //CHECK: return sil @Case4 : $@convention(thin) (@owned B) -> Int { bb0(%0 : $B): - debug_value %0 : $B // let a // id: %1 + debug_value %0 : $B, let, name "a" // id: %1 strong_retain %0 : $B // id: %2 %3 = class_method %0 : $B, #B.ping!1 : B -> () -> Int , $@convention(method) (@guaranteed B) -> Int // user: %4 %4 = apply %3(%0) : $@convention(method) (@guaranteed B) -> Int // user: %6 diff --git a/test/SILOptimizer/devirt_release.sil b/test/SILOptimizer/devirt_release.sil index 2908c647e75..bc68162cc90 100644 --- a/test/SILOptimizer/devirt_release.sil +++ b/test/SILOptimizer/devirt_release.sil @@ -223,7 +223,7 @@ sil @unknown_func : $@convention(thin) () -> () sil hidden @_TFC4test1BD : $@convention(method) (@owned B) -> () { // %0 // users: %1, %3 bb0(%0 : $B): - debug_value %0 : $B // let self // id: %1 + debug_value %0 : $B, let, name "self" // id: %1 // function_ref test.B.deinit %2 = function_ref @_TFC4test1Bd : $@convention(method) (@guaranteed B) -> @owned Builtin.NativeObject // user: %3 %3 = apply %2(%0) : $@convention(method) (@guaranteed B) -> @owned Builtin.NativeObject // user: %4 @@ -237,7 +237,7 @@ bb0(%0 : $B): sil hidden @_TFC4test1Bd : $@convention(method) (@guaranteed B) -> @owned Builtin.NativeObject { // %0 // users: %1, %2 bb0(%0 : $B): - debug_value %0 : $B // let self // id: %1 + debug_value %0 : $B, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $B to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } @@ -246,7 +246,7 @@ bb0(%0 : $B): sil hidden @_TFC4test1BcfT_S0_ : $@convention(method) (@owned B) -> @owned B { // %0 // users: %1, %2 bb0(%0 : $B): - debug_value %0 : $B // let self // id: %1 + debug_value %0 : $B, let, name "self" // id: %1 return %0 : $B // id: %2 } @@ -259,7 +259,7 @@ sil_vtable B { sil hidden @_TFC4test14MyArrayStorageD : $@convention(method) (@owned MyArrayStorage) -> () { // %0 // users: %1, %3 bb0(%0 : $MyArrayStorage): - debug_value %0 : $MyArrayStorage // let self // id: %1 + debug_value %0 : $MyArrayStorage, let, name "self" // id: %1 // function_ref test.MyArrayStorage.deinit %2 = function_ref @_TFC4test14MyArrayStoraged : $@convention(method) <τ_0_0> (@guaranteed MyArrayStorage<τ_0_0>) -> @owned Builtin.NativeObject // user: %3 %3 = apply %2(%0) : $@convention(method) <τ_0_0> (@guaranteed MyArrayStorage<τ_0_0>) -> @owned Builtin.NativeObject // user: %4 @@ -273,7 +273,7 @@ bb0(%0 : $MyArrayStorage): sil hidden @_TFC4test14MyArrayStoraged : $@convention(method) (@guaranteed MyArrayStorage) -> @owned Builtin.NativeObject { // %0 // users: %1, %2 bb0(%0 : $MyArrayStorage): - debug_value %0 : $MyArrayStorage // let self // id: %1 + debug_value %0 : $MyArrayStorage, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $MyArrayStorage to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } @@ -282,7 +282,7 @@ bb0(%0 : $MyArrayStorage): sil hidden @_TFC4test14MyArrayStoragecfT_GS0_x_ : $@convention(method) (@owned MyArrayStorage) -> @owned MyArrayStorage { // %0 // users: %1, %2 bb0(%0 : $MyArrayStorage): - debug_value %0 : $MyArrayStorage // let self // id: %1 + debug_value %0 : $MyArrayStorage, let, name "self" // id: %1 return %0 : $MyArrayStorage // id: %2 } diff --git a/test/SILOptimizer/earlycodemotion.sil b/test/SILOptimizer/earlycodemotion.sil index 74732c1eb45..bde79e6c5c2 100644 --- a/test/SILOptimizer/earlycodemotion.sil +++ b/test/SILOptimizer/earlycodemotion.sil @@ -1416,7 +1416,7 @@ class Y : X { } sil @canonicalize_releases : $@convention(thin) (@owned Optional) -> () { bb0(%0 : $Optional): - debug_value %0 : $Optional // let x // id: %1 + debug_value %0 : $Optional, let, name "x" // id: %1 switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: bb1, case #Optional.None!enumelt: bb3 // id: %2 bb1: // Preds: bb0 @@ -1463,11 +1463,11 @@ bb5: // Preds: bb1 // Make sure we are replacing all uses of %3 with %0. sil @canonicalize_casts: $@convention(thin) (@owned X) -> Int32 { bb0(%0 : $X): - debug_value %0 : $X // let x // id: %1 + debug_value %0 : $X, let, name "x" // id: %1 checked_cast_br %0 : $X to $Y, bb1, bb3 // id: %2 bb1(%3 : $Y): // Preds: bb0 - debug_value %3 : $Y // let z // id: %4 + debug_value %3 : $Y, let, name "z" // id: %4 %5 = upcast %3 : $Y to $X // users: %6, %7, %21, %23 %6 = class_method %5 : $X, #X.ping!1 : X -> () -> () , $@convention(method) (@guaranteed X) -> () // users: %21, %23 checked_cast_br [exact] %5 : $X to $Y, bb5, bb6 // id: %7 @@ -1561,19 +1561,19 @@ bb3(%z1 : $Builtin.RawPointer): // CHECK-LABEL: sil hidden @sink_allocation_inst sil hidden @sink_allocation_inst : $@convention(thin) (Boo, Boo) -> Bool { bb0(%0 : $Boo, %1 : $Boo): - debug_value %0 : $Boo // let x // id: %2 + debug_value %0 : $Boo, let, name "x" // id: %2 debug_value %0 : $Boo // id: %3 - debug_value %0 : $Boo // let self // id: %4 + debug_value %0 : $Boo, let, name "self" // id: %4 switch_enum %0 : $Boo, case #Boo.one!enumelt: bb1, case #Boo.two!enumelt: bb3 // id: %5 bb1: // Preds: bb0 %6 = alloc_ref $fuzz // users: %7, %8 - debug_value %6 : $fuzz // let self // id: %7 + debug_value %6 : $fuzz, let, name "self" // id: %7 br bb2(%6 : $fuzz) // id: %8 bb3: // Preds: bb0 %15 = alloc_ref $fuzz // users: %16, %17 - debug_value %15 : $fuzz // let self // id: %16 + debug_value %15 : $fuzz, let, name "self" // id: %16 br bb2(%15 : $fuzz) // id: %17 bb2(%9 : $fuzz): @@ -1581,7 +1581,7 @@ bb2(%9 : $fuzz): // CHECK: alloc_ref // CHECK-NOT: alloc_ref // CHECK: return - debug_value %9 : $fuzz // let lhs // id: %10 + debug_value %9 : $fuzz, let, name "lhs" // id: %10 %11 = integer_literal $Builtin.Int1, -1 // user: %12 %12 = struct $Bool (%11 : $Builtin.Int1) // user: %14 strong_release %9 : $fuzz // id: %13 diff --git a/test/SILOptimizer/fold_enums.sil b/test/SILOptimizer/fold_enums.sil index 013803bf1e4..09ce1918f0b 100644 --- a/test/SILOptimizer/fold_enums.sil +++ b/test/SILOptimizer/fold_enums.sil @@ -23,11 +23,11 @@ public enum E { // CHECK: return %0 : $Optional sil @_TF10fold_enums18recreate_optional1FGSqVs5Int32_GSqS0__ : $@convention(thin) (Optional) -> Optional { bb0(%0 : $Optional): - debug_value %0 : $Optional // let x // id: %1 + debug_value %0 : $Optional, let, name "x" // id: %1 switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: bb1, default bb2 // id: %2 bb1(%3 : $Int32): // Preds: bb0 - debug_value %3 : $Int32 // let y // id: %4 + debug_value %3 : $Int32, let, name "y" // id: %4 %5 = enum $Optional, #Optional.Some!enumelt.1, %3 : $Int32 // user: %6 br bb3(%5 : $Optional) // id: %6 @@ -71,11 +71,11 @@ bb3(%8 : $Optional): // CHECK: return %0 : $Optional sil @_TF10fold_enums18recreate_optional2FGSqVs5Int32_GSqS0__ : $@convention(thin) (Optional) -> Optional { bb0(%0 : $Optional): - debug_value %0 : $Optional // let x // id: %1 + debug_value %0 : $Optional, let, name "x" // id: %1 switch_enum %0 : $Optional, case #Optional.Some!enumelt.1: bb1, default bb2 // id: %2 bb1(%3 : $Int32): // Preds: bb0 - debug_value %3 : $Int32 // let y // id: %4 + debug_value %3 : $Int32, let, name "y" // id: %4 %5 = enum $Optional, #Optional.Some!enumelt.1, %3 : $Int32 // user: %6 br bb3(%5 : $Optional) // id: %6 @@ -98,21 +98,21 @@ bb3(%13 : $Optional): // Preds: bb1 bb2 // CHECK: return %0 : $E sil @_TF10fold_enums13recreate_enumFOS_1ES0_ : $@convention(thin) (E) -> E { bb0(%0 : $E): - debug_value %0 : $E // let e // id: %1 + debug_value %0 : $E, let, name "e" // id: %1 switch_enum %0 : $E, case #E.C1!enumelt.1: bb1, case #E.C2!enumelt.1: bb2, case #E.C3!enumelt.1: bb3 // id: %2 bb1(%3 : $Int32): // Preds: bb0 - debug_value %3 : $Int32 // let x // id: %4 + debug_value %3 : $Int32, let, name "x" // id: %4 %5 = enum $E, #E.C1!enumelt.1, %3 : $Int32 // user: %6 br bb4(%5 : $E) // id: %6 bb2(%7 : $Int32): // Preds: bb0 - debug_value %7 : $Int32 // let x // id: %8 + debug_value %7 : $Int32, let, name "x" // id: %8 %9 = enum $E, #E.C2!enumelt.1, %7 : $Int32 // user: %10 br bb4(%9 : $E) // id: %10 bb3(%11 : $Int32): // Preds: bb0 - debug_value %11 : $Int32 // let x // id: %12 + debug_value %11 : $Int32, let, name "x" // id: %12 %13 = enum $E, #E.C3!enumelt.1, %11 : $Int32 // user: %14 br bb4(%13 : $E) // id: %14 @@ -129,21 +129,21 @@ bb4(%15 : $E): // Preds: bb1 bb2 bb3 // CHECK: return sil @_TF10fold_enums26create_different_enum_caseFOS_1ES0_ : $@convention(thin) (E) -> E { bb0(%0 : $E): - debug_value %0 : $E // let e // id: %1 + debug_value %0 : $E, let, name "e" // id: %1 switch_enum %0 : $E, case #E.C1!enumelt.1: bb1, case #E.C2!enumelt.1: bb2, case #E.C3!enumelt.1: bb3 // id: %2 bb1(%3 : $Int32): // Preds: bb0 - debug_value %3 : $Int32 // let x // id: %4 + debug_value %3 : $Int32, let, name "x" // id: %4 %5 = enum $E, #E.C2!enumelt.1, %3 : $Int32 // user: %6 br bb4(%5 : $E) // id: %6 bb2(%7 : $Int32): // Preds: bb0 - debug_value %7 : $Int32 // let x // id: %8 + debug_value %7 : $Int32, let, name "x" // id: %8 %9 = enum $E, #E.C3!enumelt.1, %7 : $Int32 // user: %10 br bb4(%9 : $E) // id: %10 bb3(%11 : $Int32): // Preds: bb0 - debug_value %11 : $Int32 // let x // id: %12 + debug_value %11 : $Int32, let, name "x" // id: %12 %13 = enum $E, #E.C1!enumelt.1, %11 : $Int32 // user: %14 br bb4(%13 : $E) // id: %14 @@ -163,15 +163,15 @@ public enum F { // CHECK: return %0 : $F sil @_TF10fold_enums13recreate_enumFOS_1FS0_ : $@convention(thin) (@owned F) -> @owned F { bb0(%0 : $F): - debug_value %0 : $F // let e // id: %1 + debug_value %0 : $F, let, name "e" // id: %1 retain_value %0 : $F // id: %2 switch_enum %0 : $F, case #F.F1!enumelt.1: bb1, case #F.F2!enumelt.1: bb2, case #F.F3!enumelt.1: bb3 // id: %3 bb1(%4 : $(Int32, Int32)): // Preds: bb0 %5 = tuple_extract %4 : $(Int32, Int32), 0 // users: %7, %9 %6 = tuple_extract %4 : $(Int32, Int32), 1 // users: %8, %9 - debug_value %5 : $Int32 // let x // id: %7 - debug_value %6 : $Int32 // let y // id: %8 + debug_value %5 : $Int32, let, name "x" // id: %7 + debug_value %6 : $Int32, let, name "y" // id: %8 %9 = tuple (%5 : $Int32, %6 : $Int32) // user: %10 %10 = enum $F, #F.F1!enumelt.1, %9 : $(Int32, Int32) // user: %11 br bb4(%10 : $F) // id: %11 @@ -179,8 +179,8 @@ bb1(%4 : $(Int32, Int32)): // Preds: bb0 bb2(%12 : $(Int32, String)): // Preds: bb0 %13 = tuple_extract %12 : $(Int32, String), 0 // users: %15, %18 %14 = tuple_extract %12 : $(Int32, String), 1 // users: %16, %17, %18, %20 - debug_value %13 : $Int32 // let x // id: %15 - debug_value %14 : $String // let y // id: %16 + debug_value %13 : $Int32, let, name "x" // id: %15 + debug_value %14 : $String, let, name "y" // id: %16 retain_value %14 : $String // id: %17 %18 = tuple (%13 : $Int32, %14 : $String) // user: %19 %19 = enum $F, #F.F2!enumelt.1, %18 : $(Int32, String) // user: %21 @@ -191,9 +191,9 @@ bb3(%22 : $(Float, Float, Float)): // Preds: bb0 %23 = tuple_extract %22 : $(Float, Float, Float), 0 // users: %26, %29 %24 = tuple_extract %22 : $(Float, Float, Float), 1 // users: %27, %29 %25 = tuple_extract %22 : $(Float, Float, Float), 2 // users: %28, %29 - debug_value %23 : $Float // let x // id: %26 - debug_value %24 : $Float // let y // id: %27 - debug_value %25 : $Float // let z // id: %28 + debug_value %23 : $Float, let, name "x" // id: %26 + debug_value %24 : $Float, let, name "y" // id: %27 + debug_value %25 : $Float, let, name "z" // id: %28 %29 = tuple (%23 : $Float, %24 : $Float, %25 : $Float) // user: %30 %30 = enum $F, #F.F3!enumelt.1, %29 : $(Float, Float, Float) // user: %31 br bb4(%30 : $F) // id: %31 diff --git a/test/SILOptimizer/global_arc_unique_check.sil b/test/SILOptimizer/global_arc_unique_check.sil index 252327f6caa..a95d2077950 100644 --- a/test/SILOptimizer/global_arc_unique_check.sil +++ b/test/SILOptimizer/global_arc_unique_check.sil @@ -66,7 +66,7 @@ class C {} sil @test_uniq_alias : $@convention(method) (@owned C) -> Builtin.Int1 { // CHECK: bb0 bb0(%0 : $C): - %1 = alloc_stack $C // var x + %1 = alloc_stack $C, var, name "x" store %0 to %1#1 : $*C // CHECK: strong_retain %0 : $C strong_retain %0 : $C diff --git a/test/SILOptimizer/inlinecaches_arc.sil b/test/SILOptimizer/inlinecaches_arc.sil index a7beeab742e..444a7bda62d 100644 --- a/test/SILOptimizer/inlinecaches_arc.sil +++ b/test/SILOptimizer/inlinecaches_arc.sil @@ -31,7 +31,7 @@ sil @_TFC4main3FoocfMS0_FT_S0_ : $@convention(method) (@owned Foo) -> @owned Foo // CHECK-NOT: strong_release sil @_TF4main7my_mainFCS_3FooSi : $@convention(thin) (@owned Foo) -> Int { bb0(%0 : $Foo): - debug_value %0 : $Foo // let x // id: %1 + debug_value %0 : $Foo, let, name "x" // id: %1 %3 = class_method %0 : $Foo, #Foo.ping!1 : Foo -> () -> Int , $@convention(method) (@guaranteed Foo) -> Int // user: %4 %4 = apply %3(%0) : $@convention(method) (@guaranteed Foo) -> Int // user: %6 strong_release %0 : $Foo // id: %5 diff --git a/test/SILOptimizer/inlinecaches_objc.sil b/test/SILOptimizer/inlinecaches_objc.sil index 887644216b1..728038c0ceb 100644 --- a/test/SILOptimizer/inlinecaches_objc.sil +++ b/test/SILOptimizer/inlinecaches_objc.sil @@ -17,7 +17,7 @@ sil @_TFC4main1XcfMS0_FT_S0_ : $@convention(method) (@owned X) -> @owned X // CHECK: return sil @_TF4main1fFCS_1XT_ : $@convention(thin) (@owned X) -> () { bb0(%0 : $X): - debug_value %0 : $X // let x // id: %1 + debug_value %0 : $X, let, name "x" // id: %1 strong_retain %0 : $X // id: %2 %3 = class_method [volatile] %0 : $X, #X.ping!1.foreign : X -> () -> () , $@convention(objc_method) (X) -> () // user: %4 %4 = apply %3(%0) : $@convention(objc_method) (X) -> () diff --git a/test/SILOptimizer/inout_deshadow.sil b/test/SILOptimizer/inout_deshadow.sil index a70da77e374..cfa7fa21dd1 100644 --- a/test/SILOptimizer/inout_deshadow.sil +++ b/test/SILOptimizer/inout_deshadow.sil @@ -13,7 +13,7 @@ sil @takeInt : $@convention(method) (@inout Int64) -> () sil @TrivialTest : $@convention(thin) (@inout Int64) -> () { bb0(%0 : $*Int64): - %1 = alloc_stack $Int64 // var a // users: %6, %2, %4, %5 + %1 = alloc_stack $Int64, var, name "a" // users: %6, %2, %4, %5 copy_addr %0 to [initialization] %1#1 : $*Int64 %3 = function_ref @takeInt : $@convention(method) (@inout Int64) -> () // user: %4 %4 = apply %3(%1#1) : $@convention(method) (@inout Int64) -> () diff --git a/test/SILOptimizer/lslocation_expansion.sil b/test/SILOptimizer/lslocation_expansion.sil index 672377ab509..663d5ecb89e 100644 --- a/test/SILOptimizer/lslocation_expansion.sil +++ b/test/SILOptimizer/lslocation_expansion.sil @@ -261,9 +261,9 @@ sil @store_after_store_struct : $@convention(thin) () -> () { // CHECK-NEXT: Field Type: var x: S3 sil hidden @many_struct_allocs : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S2 // var a // users: %6, %18 - %1 = alloc_stack $S3 // var b // users: %10, %17 - %2 = alloc_stack $S4 // var c // users: %14, %16 + %0 = alloc_stack $S2, var, name "a" // users: %6, %18 + %1 = alloc_stack $S3, var, name "b" // users: %10, %17 + %2 = alloc_stack $S4, var, name "c" // users: %14, %16 %3 = function_ref @S2_init : $@convention(thin) (@thin S2.Type) -> S2 // user: %5 %4 = metatype $@thin S2.Type // user: %5 %5 = apply %3(%4) : $@convention(thin) (@thin S2.Type) -> S2 // user: %6 @@ -286,12 +286,12 @@ bb0: // CHECK-LABEL: self_loop // CHECK: #0 store -// CHECK-NEXT: alloc_stack $S5 // users: %4, %7 +// CHECK-NEXT: alloc_stack $S5, var, name "b" // users: %4, %7 // CHECK-NEXT: Address Projection Type: $*SelfLoop // CHECK-NEXT: Field Type: var a: SelfLoop sil hidden @self_loop : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S5 // var b // users: %4, %7 + %0 = alloc_stack $S5, var, name "b" // users: %4, %7 %1 = function_ref @S5_init : $@convention(thin) (@thin S5.Type) -> S5 // user: %3 %2 = metatype $@thin S5.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S5.Type) -> S5 // users: %4, %5 diff --git a/test/SILOptimizer/lslocation_reduction.sil b/test/SILOptimizer/lslocation_reduction.sil index db8234180c7..33a75b266e1 100644 --- a/test/SILOptimizer/lslocation_reduction.sil +++ b/test/SILOptimizer/lslocation_reduction.sil @@ -131,9 +131,9 @@ sil @store_after_store_struct : $@convention(thin) () -> () { // CHECK-NEXT: alloc_stack $S4 sil hidden @many_struct_allocs : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S2 // var a // users: %6, %18 - %1 = alloc_stack $S3 // var b // users: %10, %17 - %2 = alloc_stack $S4 // var c // users: %14, %16 + %0 = alloc_stack $S2, var, name "a" // users: %6, %18 + %1 = alloc_stack $S3, var, name "b" // users: %10, %17 + %2 = alloc_stack $S4, var, name "c" // users: %14, %16 %3 = function_ref @S2_init : $@convention(thin) (@thin S2.Type) -> S2 // user: %5 %4 = metatype $@thin S2.Type // user: %5 %5 = apply %3(%4) : $@convention(thin) (@thin S2.Type) -> S2 // user: %6 @@ -156,10 +156,10 @@ bb0: // CHECK-LABEL: self_loop // CHECK: #0 store -// CHECK-NEXT: alloc_stack $S5 // users: %4, %7 +// CHECK-NEXT: alloc_stack $S5, var, name "b" // users: %4, %7 sil hidden @self_loop : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S5 // var b // users: %4, %7 + %0 = alloc_stack $S5, var, name "b" // users: %4, %7 %1 = function_ref @S5_init : $@convention(thin) (@thin S5.Type) -> S5 // user: %3 %2 = metatype $@thin S5.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S5.Type) -> S5 // users: %4, %5 diff --git a/test/SILOptimizer/lslocation_type_only_expansion.sil b/test/SILOptimizer/lslocation_type_only_expansion.sil index 77c48e776eb..7dd484ff077 100644 --- a/test/SILOptimizer/lslocation_type_only_expansion.sil +++ b/test/SILOptimizer/lslocation_type_only_expansion.sil @@ -107,8 +107,8 @@ sil @S6_init : $@convention(thin) (@thin S6.Type) -> S6 // CHECK-NEXT: Field Type: var a: Int sil hidden @test_struct_type_expansion : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S1 // var a // users: %5, %12 - %1 = alloc_stack $S2 // var b // users: %9, %11 + %0 = alloc_stack $S1, var, name "a" // users: %5, %12 + %1 = alloc_stack $S2, var, name "b" // users: %9, %11 %2 = function_ref @S1_init : $@convention(thin) (@thin S1.Type) -> S1 // user: %4 %3 = metatype $@thin S1.Type // user: %4 %4 = apply %2(%3) : $@convention(thin) (@thin S1.Type) -> S1 // user: %5 @@ -131,7 +131,7 @@ bb0: // CHECK: #1 store sil hidden @test_class_stack_slot : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $C1 // var a // users: %4, %7 + %0 = alloc_stack $C1, var, name "a" // users: %4, %7 %1 = function_ref @C1_init : $@convention(thin) (@thick C1.Type) -> @owned C1 // user: %3 %2 = metatype $@thick C1.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thick C1.Type) -> @owned C1 // users: %4, %5 @@ -173,7 +173,7 @@ bb0: // CHECK-NEXT: Field Type: var c: C1 sil hidden @test_struct_and_class_slot : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S3 // var a // users: %4, %7 + %0 = alloc_stack $S3, var, name "a" // users: %4, %7 // function_ref test.S3.init (test.S3.Type)() -> test.S3 %1 = function_ref @S3_init : $@convention(thin) (@thin S3.Type) -> @owned S3 // user: %3 %2 = metatype $@thin S3.Type // user: %3 @@ -219,7 +219,7 @@ bb0: // CHECK-NEXT: Field Type: var c: (Int, Int, S1) sil hidden @test_tuple : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S4 // var x // users: %4, %7 + %0 = alloc_stack $S4, var, name "x" // users: %4, %7 // function_ref test.S4.init (test.S4.Type)() -> test.S4 %1 = function_ref @S4_init : $@convention(thin) (@thin S4.Type) -> @owned S4 // user: %3 %2 = metatype $@thin S4.Type // user: %3 @@ -293,7 +293,7 @@ bb0: // CHECK-NEXT: Field Type: var c: (Int, Int, S3) sil hidden @tuple_test_with_reference : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S5 // var x // users: %4, %7 + %0 = alloc_stack $S5, var, name "x" // users: %4, %7 // function_ref test.S5.init (test.S5.Type)() -> test.S5 %1 = function_ref @S5_init : $@convention(thin) (@thin S5.Type) -> @owned S5 // user: %3 %2 = metatype $@thin S5.Type // user: %3 @@ -321,7 +321,7 @@ bb0: /// CHECK-NEXT: Field Type: var tuple: (Int, Int) sil hidden @tuple_inside_struct : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $S6 // var x // users: %4, %7 + %0 = alloc_stack $S6, var, name "x" // users: %4, %7 %1 = function_ref @S6_init : $@convention(thin) (@thin S6.Type) -> S6 // user: %3 %2 = metatype $@thin S6.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin S6.Type) -> S6 // users: %4, %5 @@ -345,8 +345,8 @@ bb0: /// CHECK-NEXT: Field Type: var value: Int64 sil hidden @enum_test : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $Example // var example // users: %5, %11 - %1 = alloc_stack $Int // var a // users: %8, %10 + %0 = alloc_stack $Example, var, name "ee" // users: %5, %11 + %1 = alloc_stack $Int, var, name "a" // users: %8, %10 %2 = integer_literal $Builtin.Int64, 10 // user: %3 %3 = struct $Int64 (%2 : $Builtin.Int64) // user: %4 %4 = enum $Example, #Example.A!enumelt.1, %3 : $Int64 // user: %5 diff --git a/test/SILOptimizer/mandatory_inlining.swift b/test/SILOptimizer/mandatory_inlining.swift index d4419d9c075..b2af14e3992 100644 --- a/test/SILOptimizer/mandatory_inlining.swift +++ b/test/SILOptimizer/mandatory_inlining.swift @@ -10,7 +10,7 @@ func foo(x: Float) -> Float { // CHECK-LABEL: sil hidden @_TF18mandatory_inlining3foo // CHECK: bb0(%0 : $Float): -// CHECK-NEXT: debug_value %0 : $Float // let x +// CHECK-NEXT: debug_value %0 : $Float, let, name "x" // CHECK-NEXT: return %0 @_transparent func bar(x: Float) -> Float { diff --git a/test/SILOptimizer/mem2reg.sil b/test/SILOptimizer/mem2reg.sil index 26e3e9d9673..c421fd224f8 100644 --- a/test/SILOptimizer/mem2reg.sil +++ b/test/SILOptimizer/mem2reg.sil @@ -9,7 +9,7 @@ import Swift // simple.foo0 (c : Swift.Int64) -> () sil @store_only_allocas : $@convention(thin) (Int64) -> () { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %5, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %5, %2 store %0 to %1#1 : $*Int64 // id: %2 // function_ref Swift.print (val : Swift.Int64) -> () %3 = function_ref @_Ts5printFT3valSi_T_ : $@convention(thin) (Int64) -> () // user: %4 @@ -28,9 +28,9 @@ sil @_Ts5printFT3valSi_T_ : $@convention(thin) (Int64) -> () // simple.foo1 (c : Swift.Int64) -> Swift.Int64 sil @multiple_store_vals : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %14, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %14, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %12, %11, %13, %6 + %3 = alloc_stack $Int64, var, name "x" // users: %12, %11, %13, %6 %4 = integer_literal $Builtin.Int64, 2 // user: %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -51,9 +51,9 @@ bb0(%0 : $Int64): // simple.foo2 (c : Swift.Int64) -> Swift.Int64 sil @multiple_store_vals2 : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %19, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %19, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_box $Int64 // var x // users: %16, %11, %6 + %3 = alloc_box $Int64, var, name "x" // users: %16, %11, %6 %4 = integer_literal $Builtin.Int64, 2 // users: %9, %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // users: %12, %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -81,9 +81,9 @@ bb3(%18 : $Int64): // Preds: bb2 bb1 // simple.foo2 (c : Swift.Int64) -> Swift.Int64 sil @with_loads : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %19, %2, (%20) + %1 = alloc_stack $Int64, var, name "c" // users: %19, %2, (%20) store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_box $Int64 // var x // users: %16, %11, %6 + %3 = alloc_box $Int64, var, name "x" // users: %16, %11, %6 %4 = integer_literal $Builtin.Int64, 2 // users: %9, %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // users: %12, %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -116,9 +116,9 @@ bb3(%18 : $Int64): // Preds: bb2 bb1 // test.foo3 (c : Swift.Int64) -> () sil @basic_block_with_loads_and_stores : $@convention(thin) (Int64) -> () { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %20, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %20, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %14, %19, %6, %17 + %3 = alloc_stack $Int64, var, name "x" // users: %14, %19, %6, %17 %4 = integer_literal $Builtin.Int64, 3 // user: %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6 store %5 to %3#1 : $*Int64 // id: %6 diff --git a/test/SILOptimizer/mem2reg_liveness.sil b/test/SILOptimizer/mem2reg_liveness.sil index 8e95c7b8cc1..592a041babc 100644 --- a/test/SILOptimizer/mem2reg_liveness.sil +++ b/test/SILOptimizer/mem2reg_liveness.sil @@ -9,7 +9,7 @@ sil @_Ts5printFT3valSi_T_ : $@convention(thin) (Int64) -> () // CHECK-NOT: alloc_stack sil @liveness0 : $@convention(thin) (Int64) -> () { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var x // users: %39, %2 + %1 = alloc_stack $Int64, var, name "x" // users: %39, %2 store %0 to %1#1 : $*Int64 // id: %2 %3 = integer_literal $Builtin.Int64, 10 // user: %6 %5 = struct_extract %0 : $Int64, #Int64._value // user: %6 @@ -17,7 +17,7 @@ bb0(%0 : $Int64): cond_br %6, bb1, bb5 // id: %7 bb1: // Preds: bb0 - %8 = alloc_stack $Int64 // var y // users: %23, %19, %37, %11, %26 + %8 = alloc_stack $Int64, var, name "y" // users: %23, %19, %37, %11, %26 %9 = integer_literal $Builtin.Int64, 20 // user: %10 %10 = struct $Int64 (%9 : $Builtin.Int64) // user: %11 store %10 to %8#1 : $*Int64 // id: %11 diff --git a/test/SILOptimizer/mem2reg_simple.sil b/test/SILOptimizer/mem2reg_simple.sil index 6006014efe4..4f2f69b5e64 100644 --- a/test/SILOptimizer/mem2reg_simple.sil +++ b/test/SILOptimizer/mem2reg_simple.sil @@ -20,9 +20,9 @@ import Swift sil @place_phi : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var v // users: %45, %2 + %1 = alloc_stack $Int64, var, name "v" // users: %45, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %19, %13, %44, %6, %42 + %3 = alloc_stack $Int64, var, name "x" // users: %19, %13, %44, %6, %42 %4 = integer_literal $Builtin.Int64, 0 // user: %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // users: %23, %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -52,7 +52,7 @@ bb4: // Preds: bb3 bb2 //CHECK: bb5([[PHI:%[0-9]+]] : $Int64): //CHECK-NOT: alloc_stack bb5: // Preds: bb4 bb1 - %22 = alloc_stack $Int64 // var i // users: %31, %25, %40, %43, %23 + %22 = alloc_stack $Int64, var, name "i" // users: %31, %25, %40, %43, %23 store %5 to %22#1 : $*Int64 // id: %23 br bb6 // id: %24 @@ -97,9 +97,9 @@ bb8: // Preds: bb6 //CHECK-NOT: alloc_stack sil @func_loop: $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %28, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %28, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %24, %27, %6, %8, %14, %26 + %3 = alloc_stack $Int64, var, name "x" // users: %24, %27, %6, %8, %14, %26 %4 = integer_literal $Builtin.Int64, 0 // user: %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -153,9 +153,9 @@ bb3: // Preds: bb1 //CHECK: return sil @high_nest : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %114, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %114, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %94, %113, %6, %112 + %3 = alloc_stack $Int64, var, name "x" // users: %94, %113, %6, %112 %4 = integer_literal $Builtin.Int64, 0 // user: %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6 store %5 to %3#1 : $*Int64 // id: %6 @@ -326,9 +326,9 @@ bb34: // Preds: bb33 bb0 //CHECK-NOT: alloc_stack sil @simple_if : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): - %1 = alloc_stack $Int64 // var c // users: %17, %2 + %1 = alloc_stack $Int64, var, name "c" // users: %17, %2 store %0 to %1#1 : $*Int64 // id: %2 - %3 = alloc_stack $Int64 // var x // users: %13, %16, %6, %15 + %3 = alloc_stack $Int64, var, name "x" // users: %13, %16, %6, %15 %4 = integer_literal $Builtin.Int64, 0 // users: %9, %5 //CHECK: [[INIT:%[0-9]+]] = struct $Int64 %5 = struct $Int64 (%4 : $Builtin.Int64) // user: %6 @@ -366,11 +366,11 @@ enum X { //CHECK-NOT: dealloc_stack sil @test_switch: $@convention(thin) (Int64, X) -> Int64 { bb0(%0 : $Int64, %1 : $X): - %2 = alloc_stack $Int64 // var xi // users: %28, %4 - %3 = alloc_stack $X // var c // users: %27, %5 + %2 = alloc_stack $Int64, var, name "xi" // users: %28, %4 + %3 = alloc_stack $X, var, name "c" // users: %27, %5 store %0 to %2#1 : $*Int64 // id: %4 store %1 to %3#1 : $*X // id: %5 - %6 = alloc_stack $Int64 // var x // users: %7, %23, %18, %13, %26, %25 + %6 = alloc_stack $Int64, var, name "x" // users: %7, %23, %18, %13, %26, %25 store %0 to %6#1 : $*Int64 // id: %7 %8 = tuple () switch_enum %1 : $X, case #X.One!enumelt: bb1, case #X.Two!enumelt: bb3, case #X.Three!enumelt: bb5 // id: %9 diff --git a/test/SILOptimizer/mem2reg_unreachable.sil b/test/SILOptimizer/mem2reg_unreachable.sil index d94ffe8992d..4d9bb14fca7 100644 --- a/test/SILOptimizer/mem2reg_unreachable.sil +++ b/test/SILOptimizer/mem2reg_unreachable.sil @@ -9,9 +9,9 @@ import Swift sil @_TF4main3fooFT1xSi1ySi_Si : $@convention(thin) (Int32, Int32) -> Int32 { bb0(%0 : $Int32, %1 : $Int32): - debug_value %0 : $Int32 // let x // id: %2 - debug_value %1 : $Int32 // let y // id: %3 - %4 = alloc_stack $Int32 // var g // users: %14, %18, %20, %21 + debug_value %0 : $Int32, let, name "x" // id: %2 + debug_value %1 : $Int32, let, name "y" // id: %3 + %4 = alloc_stack $Int32, var, name "g" // users: %14, %18, %20, %21 %6 = struct_extract %1 : $Int32, #Int32._value // user: %8 %7 = struct_extract %0 : $Int32, #Int32._value // user: %8 %8 = builtin "cmp_sgt_Word"(%6 : $Builtin.Int32, %7 : $Builtin.Int32) : $Builtin.Int1 // user: %9 diff --git a/test/SILOptimizer/peephole_thick_to_objc_metatype.sil b/test/SILOptimizer/peephole_thick_to_objc_metatype.sil index f0f30fde9b3..73f34a56bfc 100644 --- a/test/SILOptimizer/peephole_thick_to_objc_metatype.sil +++ b/test/SILOptimizer/peephole_thick_to_objc_metatype.sil @@ -42,11 +42,11 @@ bb0: // peephole_thick_to_objc_metatype.test_thick_to_objc_metatype_existential_metatype (peephole_thick_to_objc_metatype.X) -> Swift.AnyObject sil @_TF31peephole_thick_to_objc_metatype48test_thick_to_objc_metatype_existential_metatypeFPS_1X_Ps9AnyObject_ : $@convention(thin) (@owned X) -> @owned AnyObject { bb0(%0 : $X): - debug_value %0 : $X // let o // id: %1 + debug_value %0 : $X, let, name "o" // id: %1 %2 = existential_metatype $@thick X.Type, %0 : $X // user: %3 %3 = thick_to_objc_metatype %2 : $@thick X.Type to $@objc_metatype X.Type // user: %4 %4 = objc_existential_metatype_to_object %3 : $@objc_metatype X.Type to $AnyObject // users: %5, %7 - debug_value %4 : $AnyObject // let Ty // id: %5 + debug_value %4 : $AnyObject, let, name "Ty" // id: %5 strong_release %0 : $X // id: %6 return %4 : $AnyObject // id: %7 } @@ -61,11 +61,11 @@ bb0(%0 : $X): // peephole_thick_to_objc_metatype.test_thick_to_objc_metatype_value_metatype (A) -> Swift.AnyObject sil @_TF31peephole_thick_to_objc_metatype42test_thick_to_objc_metatype_value_metatypeUs9AnyObject__FQ_PS0__ : $@convention(thin) (@owned T) -> @owned AnyObject { bb0(%0 : $T): - debug_value %0 : $T // let o // id: %1 + debug_value %0 : $T, let, name "o" // id: %1 %2 = value_metatype $@thick T.Type, %0 : $T // user: %3 %3 = thick_to_objc_metatype %2 : $@thick T.Type to $@objc_metatype T.Type // user: %4 %4 = objc_metatype_to_object %3 : $@objc_metatype T.Type to $AnyObject // users: %5, %7 - debug_value %4 : $AnyObject // let Ty // id: %5 + debug_value %4 : $AnyObject, let, name "Ty" // id: %5 strong_release %0 : $T // id: %6 return %4 : $AnyObject // id: %7 } @@ -93,7 +93,7 @@ bb0: // CHECK: return sil @_TF31peephole_thick_to_objc_metatype48test_objc_to_thick_metatype_existential_metatypeFPS_1X_Ps9AnyObject_ : $@convention(thin) (@owned X) -> @thick X.Type { bb0(%0 : $X): - debug_value %0 : $X // let o // id: %1 + debug_value %0 : $X, let, name "o" // id: %1 %2 = existential_metatype $@objc_metatype X.Type, %0 : $X // user: %3 %3 = objc_to_thick_metatype %2 : $@objc_metatype X.Type to $@thick X.Type // user: %4 strong_release %0 : $X @@ -109,7 +109,7 @@ bb0(%0 : $X): // CHECK: return sil @_TF31peephole_thick_to_objc_metatype42test_objc_to_thick_metatype_value_metatypeUs9AnyObject__FQ_PS0__ : $@convention(thin) (@owned T) -> @thick T.Type { bb0(%0 : $T): - debug_value %0 : $T // let o // id: %1 + debug_value %0 : $T, let, name "o" // id: %1 %2 = value_metatype $@objc_metatype T.Type, %0 : $T // user: %3 %3 = objc_to_thick_metatype %2 : $@objc_metatype T.Type to $@thick T.Type // user: %4 strong_release %0 : $T diff --git a/test/SILOptimizer/peephole_trunc_and_ext.sil b/test/SILOptimizer/peephole_trunc_and_ext.sil index 9c5a104e847..4a448ae3c6d 100644 --- a/test/SILOptimizer/peephole_trunc_and_ext.sil +++ b/test/SILOptimizer/peephole_trunc_and_ext.sil @@ -31,7 +31,7 @@ struct BuiltinUWord { // test.test_trunc_u_to_s_zext_lshr_1 (BuiltinUWord) -> Swift.BuiltinWord sil @_TF4test29test_trunc_u_to_s_zext_lshr_1FSuSi : $@convention(thin) (BuiltinUWord) -> BuiltinWord { bb0(%0 : $BuiltinUWord): - debug_value %0 : $BuiltinUWord // let x // id: %1 + debug_value %0 : $BuiltinUWord, let, name "x" // id: %1 %2 = integer_literal $Builtin.Word, 1 // user: %7 br bb1 // id: %3 @@ -55,7 +55,7 @@ bb3: // Preds: bb2 %19 = struct_extract %18 : $Int64, #Int64._value // user: %21 %21 = builtin "truncOrBitCast_Int64_Word"(%19 : $Builtin.Int64) : $Builtin.Word // user: %22 %22 = struct $BuiltinWord (%21 : $Builtin.Word) // users: %23, %24 - debug_value %22 : $BuiltinWord // let v1 // id: %23 + debug_value %22 : $BuiltinWord, let, name "v1" // id: %23 return %22 : $BuiltinWord // id: %24 } @@ -70,7 +70,7 @@ bb3: // Preds: bb2 // test.test_trunc_u_to_s_zext_lshr_10 (Swift.BuiltinUWord) -> Swift.BuiltinWord sil @_TF4test30test_trunc_u_to_s_zext_lshr_10FSuSi : $@convention(thin) (BuiltinUWord) -> BuiltinWord { bb0(%0 : $BuiltinUWord): - debug_value %0 : $BuiltinUWord // let x // id: %1 + debug_value %0 : $BuiltinUWord, let, name "x" // id: %1 %2 = integer_literal $Builtin.Word, 10 // user: %7 br bb1 // id: %3 @@ -94,7 +94,7 @@ bb3: // Preds: bb2 %19 = struct_extract %18 : $Int64, #Int64._value // user: %21 %21 = builtin "truncOrBitCast_Int64_Word"(%19 : $Builtin.Int64) : $Builtin.Word // user: %22 %22 = struct $BuiltinWord (%21 : $Builtin.Word) // users: %23, %24 - debug_value %22 : $BuiltinWord // let v1 // id: %23 + debug_value %22 : $BuiltinWord, let, name "v1" // id: %23 return %22 : $BuiltinWord // id: %24 } @@ -107,8 +107,8 @@ bb3: // Preds: bb2 // test.test_trunc_u_to_s_zext_lshr_var (Swift.BuiltinUWord, Swift.BuiltinUWord) -> Swift.BuiltinWord sil @_TF4test31test_trunc_u_to_s_zext_lshr_varFTSuSu_Si : $@convention(thin) (BuiltinUWord, BuiltinUWord) -> BuiltinWord { bb0(%0 : $BuiltinUWord, %1 : $BuiltinUWord): - debug_value %0 : $BuiltinUWord // let x // id: %2 - debug_value %1 : $BuiltinUWord // let c // id: %3 + debug_value %0 : $BuiltinUWord, let, name "x" // id: %2 + debug_value %1 : $BuiltinUWord, let, name "c" // id: %3 %4 = tuple () %5 = tuple () %6 = tuple () @@ -154,7 +154,7 @@ bb4: // Preds: bb2 %43 = struct_extract %42 : $Int64, #Int64._value // user: %45 %45 = builtin "truncOrBitCast_Int64_Word"(%43 : $Builtin.Int64) : $Builtin.Word // user: %46 %46 = struct $BuiltinWord (%45 : $Builtin.Word) // users: %47, %48 - debug_value %46 : $BuiltinWord // let v1 // id: %47 + debug_value %46 : $BuiltinWord, let, name "v1" // id: %47 return %46 : $BuiltinWord // id: %48 } @@ -168,7 +168,7 @@ bb4: // Preds: bb2 // test.test_uint16_trunc_u_to_s_zext_lshr_1 (Swift.UInt16) -> Swift.UInt16 sil @_TF4test36test_uint16_trunc_u_to_s_zext_lshr_1FVs6UInt16S0_ : $@convention(thin) (UInt16) -> UInt16 { bb0(%0 : $UInt16): - debug_value %0 : $UInt16 // let x // id: %1 + debug_value %0 : $UInt16, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int16, 1 // user: %7 br bb1 // id: %3 @@ -191,7 +191,7 @@ bb3: // Preds: bb2 %18 = tuple_extract %16 : $(Builtin.Int16, Builtin.Int1), 1 // user: %19 cond_fail %18 : $Builtin.Int1 // id: %19 %20 = struct $UInt16 (%17 : $Builtin.Int16) // users: %21, %22 - debug_value %20 : $UInt16 // let v1 // id: %21 + debug_value %20 : $UInt16, let, name "v1" // id: %21 return %20 : $UInt16 // id: %22 } @@ -206,7 +206,7 @@ bb3: // Preds: bb2 // test.test_int16_trunc_u_to_s_zext_lshr_1 (Swift.UInt16) -> Swift.Int16 sil @_TF4test35test_int16_trunc_u_to_s_zext_lshr_1FVs6UInt16Vs5Int16 : $@convention(thin) (UInt16) -> Int16 { bb0(%0 : $UInt16): - debug_value %0 : $UInt16 // let x // id: %1 + debug_value %0 : $UInt16, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int16, 1 // user: %7 br bb1 // id: %3 @@ -229,7 +229,7 @@ bb3: // Preds: bb2 %18 = tuple_extract %16 : $(Builtin.Int16, Builtin.Int1), 1 // user: %19 cond_fail %18 : $Builtin.Int1 // id: %19 %20 = struct $Int16 (%17 : $Builtin.Int16) // users: %21, %22 - debug_value %20 : $Int16 // let v1 // id: %21 + debug_value %20 : $Int16, let, name "v1" // id: %21 return %20 : $Int16 // id: %22 } @@ -243,7 +243,7 @@ bb3: // Preds: bb2 // test.test_trunc_s_to_u_zext_var (Swift.BuiltinWord) -> Swift.BuiltinUWord sil @_TF4test26test_trunc_s_to_u_zext_varFSiSu : $@convention(thin) (BuiltinWord) -> BuiltinUWord { bb0(%0 : $BuiltinWord): - debug_value %0 : $BuiltinWord // let x // id: %1 + debug_value %0 : $BuiltinWord, let, name "x" // id: %1 %3 = struct_extract %0 : $BuiltinWord, #BuiltinWord.value // user: %4 %4 = builtin "zextOrBitCast_Word_Int64"(%3 : $Builtin.Word) : $Builtin.Int64 // user: %6 %6 = builtin "s_to_u_checked_conversion_Int64"(%4 : $Builtin.Int64) : $(Builtin.Int64, Builtin.Int1) // users: %7, %8 @@ -331,7 +331,7 @@ bb0: // test.test_int16_trunc_s_to_u_zext_int16 (Swift.UInt16) -> Swift.UInt16 sil @_TF4test34test_int16_trunc_s_to_u_zext_int16FVs6UInt16S0_ : $@convention(thin) (UInt16) -> UInt16 { bb0(%0 : $UInt16): - debug_value %0 : $UInt16 // let x // id: %1 + debug_value %0 : $UInt16, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int16, 1 // user: %7 br bb1 // id: %3 @@ -376,7 +376,7 @@ bb3: // Preds: bb2 // peephole_trunc_and_ext.test_s_to_s_checked_trunc_of_and (Swift.Int32) -> Swift.Int8 sil @_TF22peephole_trunc_and_ext32test_s_to_s_checked_trunc_of_andFVs5Int32Vs4Int8 : $@convention(thin) (Int32) -> Int8 { bb0(%0 : $Int32): - debug_value %0 : $Int32 // let x // id: %1 + debug_value %0 : $Int32, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int32, 127 // user: %5 %4 = struct_extract %0 : $Int32, #Int32._value // user: %5 %5 = builtin "and_Int32"(%4 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int32 // user: %6 @@ -399,7 +399,7 @@ bb0(%0 : $Int32): // peephole_trunc_and_ext.test_s_to_u_checked_trunc_of_and (Swift.Int32) -> Swift.UInt8 sil @_TF22peephole_trunc_and_ext32test_s_to_u_checked_trunc_of_andFVs5Int32Vs5UInt8 : $@convention(thin) (Int32) -> UInt8 { bb0(%0 : $Int32): - debug_value %0 : $Int32 // let x // id: %1 + debug_value %0 : $Int32, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int32, 255 // user: %5 %4 = struct_extract %0 : $Int32, #Int32._value // user: %5 %5 = builtin "and_Int32"(%4 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int32 // user: %6 @@ -422,7 +422,7 @@ bb0(%0 : $Int32): // peephole_trunc_and_ext.test_u_to_u_checked_trunc_of_and (Swift.UInt32) -> Swift.UInt8 sil @_TF22peephole_trunc_and_ext32test_u_to_u_checked_trunc_of_andFVs6UInt32Vs5UInt8 : $@convention(thin) (UInt32) -> UInt8 { bb0(%0 : $UInt32): - debug_value %0 : $UInt32 // let x // id: %1 + debug_value %0 : $UInt32, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int32, 255 // user: %5 %4 = struct_extract %0 : $UInt32, #UInt32._value // user: %5 %5 = builtin "and_Int32"(%4 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int32 // user: %6 @@ -445,7 +445,7 @@ bb0(%0 : $UInt32): // peephole_trunc_and_ext.test_u_to_s_checked_trunc_of_and (Swift.UInt32) -> Swift.Int8 sil @_TF22peephole_trunc_and_ext32test_u_to_s_checked_trunc_of_andFVs6UInt32Vs4Int8 : $@convention(thin) (UInt32) -> Int8 { bb0(%0 : $UInt32): - debug_value %0 : $UInt32 // let x // id: %1 + debug_value %0 : $UInt32, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int32, 127 // user: %5 %4 = struct_extract %0 : $UInt32, #UInt32._value // user: %5 %5 = builtin "and_Int32"(%4 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int32 // user: %6 diff --git a/test/SILOptimizer/pure_apply.swift b/test/SILOptimizer/pure_apply.swift index 0c7a18b7a8a..9141f0bd5f3 100644 --- a/test/SILOptimizer/pure_apply.swift +++ b/test/SILOptimizer/pure_apply.swift @@ -11,14 +11,14 @@ class Foo { sil @_TFC4main3Food : $@convention(method) (@owned Foo) -> @owned Builtin.NativeObject { bb0(%0 : $Foo): - debug_value %0 : $Foo // let self // id: %1 + debug_value %0 : $Foo, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $Foo to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } sil @_TFC4main3FooD : $@convention(method) (@owned Foo) -> () { bb0(%0 : $Foo): - debug_value %0 : $Foo // let self // id: %1 + debug_value %0 : $Foo, let, name "self" // id: %1 // function_ref main.Foo.deinit %2 = function_ref @_TFC4main3Food : $@convention(method) (@owned Foo) -> @owned Builtin.NativeObject // user: %3 %3 = apply %2(%0) : $@convention(method) (@owned Foo) -> @owned Builtin.NativeObject // user: %4 @@ -30,7 +30,7 @@ bb0(%0 : $Foo): sil @_TFC4main3FoocfMS0_FT_S0_ : $@convention(method) (@owned Foo) -> @owned Foo { bb0(%0 : $Foo): - debug_value %0 : $Foo // let self // id: %1 + debug_value %0 : $Foo, let, name "self" // id: %1 return %0 : $Foo // id: %2 } @@ -62,7 +62,7 @@ bb0: // function_ref main.readonly_func () -> main.Foo %0 = function_ref @_TF4main9readonly_funcFT_CS_3Foo : $@convention(thin) () -> @owned Foo // user: %1 %1 = apply %0() : $@convention(thin) () -> @owned Foo // users: %2, %3 - debug_value %1 : $Foo // let unused // id: %2 + debug_value %1 : $Foo, let, name "unused" // id: %2 strong_release %1 : $Foo // id: %3 %4 = tuple () // user: %5 return %4 : $() // id: %5 diff --git a/test/SILOptimizer/recursive_func.sil b/test/SILOptimizer/recursive_func.sil index 797c10de827..55ef7dbf5d5 100644 --- a/test/SILOptimizer/recursive_func.sil +++ b/test/SILOptimizer/recursive_func.sil @@ -31,8 +31,8 @@ bb0(%c : $Builtin.Int32, %v : $Builtin.RawPointer): sil @REC_recursive : $@convention(method) (Int, @guaranteed REC) -> () { bb0(%0 : $Int, %1 : $REC): - debug_value %0 : $Int // let a // id: %2 - debug_value %1 : $REC // let self // id: %3 + debug_value %0 : $Int, let, name "a" // id: %2 + debug_value %1 : $REC, let, name "self" // id: %3 // function_ref Swift.Bool._getBuiltinLogicValue (Swift.Bool)() -> Builtin.Int1 %4 = function_ref @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $@convention(method) (Bool) -> Builtin.Int1 // user: %11 // function_ref Swift.>= @infix (Swift.Int, Swift.Int) -> Swift.Bool @@ -92,7 +92,7 @@ sil [transparent] @_TFsoi1sFTSiSi_Si : $@convention(thin) (Int, Int) -> Int // test.REC.deinit sil @_TFC4test3RECd : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $REC to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } @@ -100,7 +100,7 @@ bb0(%0 : $REC): // test.REC.__deallocating_deinit sil @_TFC4test3RECD : $@convention(method) (@owned REC) -> () { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 // function_ref test.REC.deinit %2 = function_ref @_TFC4test3RECd : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject // user: %3 %3 = apply %2(%0) : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject // user: %4 @@ -113,7 +113,7 @@ bb0(%0 : $REC): // test.REC.init (test.REC.Type)() -> test.REC sil @_TFC4test3RECcfMS0_FT_S0_ : $@convention(method) (@owned REC) -> @owned REC { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 %2 = mark_uninitialized [rootself] %0 : $REC // user: %3 return %2 : $REC // id: %3 } @@ -131,12 +131,12 @@ bb0(%0 : $@thick REC.Type): // test.test (Swift.Int) -> () sil @_TF4test4testFSiT_ : $@convention(thin) (Int) -> () { bb0(%0 : $Int): - debug_value %0 : $Int // let N // id: %1 + debug_value %0 : $Int, let, name "N" // id: %1 // function_ref test.REC.__allocating_init (test.REC.Type)() -> test.REC %2 = function_ref @_TFC4test3RECCfMS0_FT_S0_ : $@convention(thin) (@thick REC.Type) -> @owned REC // user: %4 %3 = metatype $@thick REC.Type // user: %4 %4 = apply %2(%3) : $@convention(thin) (@thick REC.Type) -> @owned REC // users: %5, %6, %7, %8, %9 - debug_value %4 : $REC // let rec // id: %5 + debug_value %4 : $REC, let, name "rec" // id: %5 strong_retain %4 : $REC // id: %6 %7 = class_method %4 : $REC, #REC.recursive!1 : REC -> (Int) -> () , $@convention(method) (Int, @guaranteed REC) -> () // user: %8 %8 = apply %7(%0, %4) : $@convention(method) (Int, @guaranteed REC) -> () diff --git a/test/SILOptimizer/recursive_single.sil b/test/SILOptimizer/recursive_single.sil index 070c8e9439c..83ad8cb2870 100644 --- a/test/SILOptimizer/recursive_single.sil +++ b/test/SILOptimizer/recursive_single.sil @@ -33,8 +33,8 @@ bb0(%c : $Builtin.Int32, %v : $Builtin.RawPointer): // single.REC.recursive (single.REC)(Swift.Int) -> () sil @_TFC6single3REC9recursivefS0_FSiT_ : $@convention(method) (Int, @guaranteed REC) -> () { bb0(%0 : $Int, %1 : $REC): - debug_value %0 : $Int // let a // id: %2 - debug_value %1 : $REC // let self // id: %3 + debug_value %0 : $Int, let, name "a" // id: %2 + debug_value %1 : $REC, let, name "self" // id: %3 // function_ref Swift.Bool._getBuiltinLogicValue (Swift.Bool)() -> Builtin.Int1 %4 = function_ref @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $@convention(method) (Bool) -> Builtin.Int1 // user: %11 // function_ref Swift.>= @infix (Swift.Int, Swift.Int) -> Swift.Bool @@ -83,7 +83,7 @@ sil [transparent] @_TFsoi1sFTSiSi_Si : $@convention(thin) (Int, Int) -> Int // single.REC.deinit sil @_TFC6single3RECd : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 %2 = unchecked_ref_cast %0 : $REC to $Builtin.NativeObject // user: %3 return %2 : $Builtin.NativeObject // id: %3 } @@ -91,7 +91,7 @@ bb0(%0 : $REC): // single.REC.__deallocating_deinit sil @_TFC6single3RECD : $@convention(method) (@owned REC) -> () { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 // function_ref single.REC.deinit %2 = function_ref @_TFC6single3RECd : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject // user: %3 %3 = apply %2(%0) : $@convention(method) (@owned REC) -> @owned Builtin.NativeObject // user: %4 @@ -104,7 +104,7 @@ bb0(%0 : $REC): // single.REC.init (single.REC.Type)() -> single.REC sil @_TFC6single3RECcfMS0_FT_S0_ : $@convention(method) (@owned REC) -> @owned REC { bb0(%0 : $REC): - debug_value %0 : $REC // let self // id: %1 + debug_value %0 : $REC, let, name "self" // id: %1 %2 = mark_uninitialized [rootself] %0 : $REC // user: %3 return %2 : $REC // id: %3 } @@ -122,12 +122,12 @@ bb0(%0 : $@thick REC.Type): // single.test (Swift.Int) -> () sil @_TF6single4testFSiT_ : $@convention(thin) (Int) -> () { bb0(%0 : $Int): - debug_value %0 : $Int // let N // id: %1 + debug_value %0 : $Int, let, name "N" // id: %1 // function_ref single.REC.__allocating_init (single.REC.Type)() -> single.REC %2 = function_ref @_TFC6single3RECCfMS0_FT_S0_ : $@convention(thin) (@thick REC.Type) -> @owned REC // user: %4 %3 = metatype $@thick REC.Type // user: %4 %4 = apply %2(%3) : $@convention(thin) (@thick REC.Type) -> @owned REC // users: %5, %6, %7, %8, %9 - debug_value %4 : $REC // let rec // id: %5 + debug_value %4 : $REC, let, name "rec" // id: %5 strong_retain %4 : $REC // id: %6 %7 = class_method %4 : $REC, #REC.recursive!1 : REC -> (Int) -> () , $@convention(method) (Int, @guaranteed REC) -> () // user: %8 %8 = apply %7(%0, %4) : $@convention(method) (Int, @guaranteed REC) -> () diff --git a/test/SILOptimizer/redundantloadelimination.sil b/test/SILOptimizer/redundantloadelimination.sil index 9bfedbcdb14..67662d97f1d 100644 --- a/test/SILOptimizer/redundantloadelimination.sil +++ b/test/SILOptimizer/redundantloadelimination.sil @@ -736,7 +736,7 @@ bb3: // Preds: bb1 bb2 // CHECK: return sil hidden @agg_and_field_store_branches_diamond : $@convention(thin) (Bool) -> () { bb0(%0 : $Bool): - %1 = alloc_stack $TwoField // var x // users: %6, %11, %16, %21, %24 + %1 = alloc_stack $TwoField, var, name "x" // users: %6, %11, %16, %21, %24 %7 = struct_extract %0 : $Bool, #Bool.value // user: %8 cond_br %7, bb1, bb2 // id: %8 diff --git a/test/SILOptimizer/sil_combine.sil b/test/SILOptimizer/sil_combine.sil index a2e24b32386..d60a482eff1 100644 --- a/test/SILOptimizer/sil_combine.sil +++ b/test/SILOptimizer/sil_combine.sil @@ -1938,7 +1938,7 @@ bb0(%0 : $XX): %2 = existential_metatype $@thick XX.Type, %0 : $XX // user: %3 %3 = thick_to_objc_metatype %2 : $@thick XX.Type to $@objc_metatype XX.Type // user: %4 %4 = objc_existential_metatype_to_object %3 : $@objc_metatype XX.Type to $AnyObject // users: %5, %6 - debug_value %4 : $AnyObject // let obj1 // id: %5 + debug_value %4 : $AnyObject, let, name "obj1" // id: %5 strong_release %4 : $AnyObject // id: %6 strong_release %0 : $XX // id: %7 %8 = tuple () // user: %9 @@ -2670,10 +2670,10 @@ final class NClass { // CHECK: return [[R]] sil @narrow_load_with_debug_value : $@convention(thin) (@owned NClass) -> Int { bb0(%0 : $NClass): - debug_value %0 : $NClass // let c // id: %1 + debug_value %0 : $NClass, let, name "c" // id: %1 %2 = ref_element_addr %0 : $NClass, #NClass.s // user: %3 %3 = load %2 : $*NStruct // users: %4, %5 - debug_value %3 : $NStruct // let xx // id: %4 + debug_value %3 : $NStruct, let, name "xx" // id: %4 %5 = struct_extract %3 : $NStruct, #NStruct.a // user: %7 strong_release %0 : $NClass // id: %6 return %5 : $Int // id: %7 @@ -2706,7 +2706,7 @@ enum VendingMachineError: ErrorType { // CHECK: return sil hidden @RemoveUnusedException : $@convention(thin) (Int32) -> (Double, @error ErrorType) { bb0(%0 : $Int32): - debug_value %0 : $Int32 // let x // id: %1 + debug_value %0 : $Int32, let, name "x" // id: %1 %2 = integer_literal $Builtin.Int32, 10 // user: %4 %3 = struct_extract %0 : $Int32, #Int32._value // user: %4 %4 = builtin "cmp_sgt_Int32"(%3 : $Builtin.Int32, %2 : $Builtin.Int32) : $Builtin.Int1 // user: %5 @@ -2716,7 +2716,7 @@ bb1: // Preds: bb0 %6 = alloc_existential_box $ErrorType, $VendingMachineError // users: %8, %9, %13 %7 = enum $VendingMachineError, #VendingMachineError.OutOfStock!enumelt // user: %8 store %7 to %6#1 : $*VendingMachineError // id: %8 - debug_value %6#0 : $ErrorType // let error // id: %9 + debug_value %6#0 : $ErrorType, let, name "error" // id: %9 %10 = float_literal $Builtin.FPIEEE80, 0x3FFF8000000000000000 // 1 // user: %11 %11 = builtin "fptrunc_FPIEEE80_FPIEEE64"(%10 : $Builtin.FPIEEE80) : $Builtin.FPIEEE64 // user: %12 %12 = struct $Double (%11 : $Builtin.FPIEEE64) // user: %14 diff --git a/test/SILOptimizer/sil_combine_enums.sil b/test/SILOptimizer/sil_combine_enums.sil index b09ef3b0f74..d254a1362b1 100644 --- a/test/SILOptimizer/sil_combine_enums.sil +++ b/test/SILOptimizer/sil_combine_enums.sil @@ -17,7 +17,7 @@ sil @external_func: $@convention(thin) () -> () //CHECK: return sil @eliminate_sw_enum_addr : $@convention(thin) () -> Int { bb0: - %0 = alloc_stack $Optional // var x // users: %2, %4, %5, %17, %19 + %0 = alloc_stack $Optional, var, name "x" // users: %2, %4, %5, %17, %19 %1 = alloc_ref $SomeClass // user: %3 %2 = init_enum_data_addr %0#1 : $*Optional, #Optional.Some!enumelt.1 // user: %3 store %1 to %2 : $*SomeClass // id: %3 diff --git a/test/SILOptimizer/sil_concat_string_literals.sil b/test/SILOptimizer/sil_concat_string_literals.sil index 76879b39320..a3c15c0e747 100644 --- a/test/SILOptimizer/sil_concat_string_literals.sil +++ b/test/SILOptimizer/sil_concat_string_literals.sil @@ -14,7 +14,7 @@ import Swift // StringConcat.testStringConcat_UnicodeScalarLiteral_UnicodeScalarLiteral () -> Swift.String sil @_TF12StringConcat58testStringConcat_UnicodeScalarLiteral_UnicodeScalarLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -44,7 +44,7 @@ bb0: // StringConcat.testStringConcat_UnicodeScalarLiteral_ExtendedGraphemeClusterLiteral () -> Swift.String sil @_TF12StringConcat68testStringConcat_UnicodeScalarLiteral_ExtendedGraphemeClusterLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -83,7 +83,7 @@ sil [readonly] [_semantics "string.makeUTF16"] @_TFSS37_convertFromBuiltinUTF16S // StringConcat.testStringConcat_UnicodeScalarLiteral_StringLiteral () -> Swift.String sil @_TF12StringConcat51testStringConcat_UnicodeScalarLiteral_StringLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -113,7 +113,7 @@ bb0: // StringConcat.testStringConcat_ExtendedGraphemeClusterLiteral_UnicodeScalarLiteral () -> Swift.String sil @_TF12StringConcat68testStringConcat_ExtendedGraphemeClusterLiteral_UnicodeScalarLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinUTF16StringLiteral (Swift.String.Type)(Builtin.RawPointer, numberOfCodeUnits : Builtin.Word) -> Swift.String @@ -143,7 +143,7 @@ bb0: // StringConcat.testStringConcat_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteral () -> Swift.String sil @_TF12StringConcat78testStringConcat_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinUTF16StringLiteral (Swift.String.Type)(Builtin.RawPointer, numberOfCodeUnits : Builtin.Word) -> Swift.String @@ -173,7 +173,7 @@ bb0: // StringConcat.testStringConcat_ExtendedGraphemeClusterLiteral_StringLiteral () -> Swift.String sil @_TF12StringConcat61testStringConcat_ExtendedGraphemeClusterLiteral_StringLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinUTF16StringLiteral (Swift.String.Type)(Builtin.RawPointer, numberOfCodeUnits : Builtin.Word) -> Swift.String @@ -203,7 +203,7 @@ bb0: // StringConcat.testStringConcat_StringLiteral_UnicodeScalarLiteral () -> Swift.String sil @_TF12StringConcat51testStringConcat_StringLiteral_UnicodeScalarLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -233,7 +233,7 @@ bb0: // StringConcat.testStringConcat_StringLiteral_ExtendedGraphemeClusterLiteral () -> Swift.String sil @_TF12StringConcat61testStringConcat_StringLiteral_ExtendedGraphemeClusterLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -263,7 +263,7 @@ bb0: // StringConcat.testStringConcat_StringLiteral_StringLiteral () -> Swift.String sil @_TF12StringConcat44testStringConcat_StringLiteral_StringLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %15, %16 + %0 = alloc_stack $String, var, name "s" // users: %15, %16 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %14 // function_ref Swift.String._convertFromBuiltinStringLiteral (Swift.String.Type)(Builtin.RawPointer, byteSize : Builtin.Word, isASCII : Builtin.Int1) -> Swift.String @@ -295,7 +295,7 @@ bb0: // StringConcat.testStringConcat_StringLiteral_StringLiteral_StringLiteral_StringLiteral () -> Swift.String sil @_TF12StringConcat72testStringConcat_StringLiteral_StringLiteral_StringLiteral_StringLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %31, %32 + %0 = alloc_stack $String, var, name "s" // users: %31, %32 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %30 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String @@ -346,7 +346,7 @@ bb0: // StringConcat.testStringConcat_StringLiteral_UnicodeScalarLiteral_ExtendedGraphemeClusterLiteral () -> Swift.String sil @_TF12StringConcat82testStringConcat_StringLiteral_UnicodeScalarLiteral_ExtendedGraphemeClusterLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %23, %24 + %0 = alloc_stack $String, var, name "s" // users: %23, %24 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %22 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String @@ -388,7 +388,7 @@ bb0: // StringConcat.testStringConcat_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteral () -> Swift.String sil @_TF12StringConcat109testStringConcat_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteral_ExtendedGraphemeClusterLiteralFT_SS : $@convention(thin) () -> @owned String { bb0: - %0 = alloc_stack $String // var s // users: %23, %24 + %0 = alloc_stack $String, var, name "s" // users: %23, %24 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String %1 = function_ref @_TFsoi1pFTSSSS_SS : $@convention(thin) (@owned String, @owned String) -> @owned String // user: %22 // function_ref Swift.+ infix (Swift.String, Swift.String) -> Swift.String diff --git a/test/SILOptimizer/simp_enum.sil b/test/SILOptimizer/simp_enum.sil index 297bab80d4b..cb246944bbc 100644 --- a/test/SILOptimizer/simp_enum.sil +++ b/test/SILOptimizer/simp_enum.sil @@ -23,7 +23,7 @@ enum SimpleEnum { // main.test_union_1 (E : main.SimpleEnum) -> main.SimpleEnum sil @_TF4main12test_union_1FT1EOS_10SimpleEnum_S0_ : $@convention(thin) (SimpleEnum) -> SimpleEnum { bb0(%0 : $SimpleEnum): - %1 = alloc_stack $SimpleEnum // var E // users: %16, %2 + %1 = alloc_stack $SimpleEnum, var, name "E" // users: %16, %2 store %0 to %1#1 : $*SimpleEnum // id: %2 %3 = tuple () switch_enum %0 : $SimpleEnum, case #SimpleEnum.Empty!enumelt: bb1, case #SimpleEnum.HasInt!enumelt.1: bb3, case #SimpleEnum.HasInt2!enumelt.1:bb4 // id: %4 @@ -33,14 +33,14 @@ bb1: // Preds: bb0 br bb5(%6 : $SimpleEnum) // id: %7 bb3(%8 : $Int): // Preds: bb0 - %9 = alloc_stack $Int // var N // users: %13, %10 + %9 = alloc_stack $Int, var, name "N" // users: %13, %10 store %8 to %9#1 : $*Int // id: %10 %12 = enum $SimpleEnum, #SimpleEnum.HasInt2!enumelt.1, %8 : $Int // user: %14 dealloc_stack %9#0 : $*@local_storage Int // id: %13 br bb5(%12 : $SimpleEnum) // id: %14 bb4(%13 : $Int): // Preds: bb0 - %14 = alloc_stack $Int // var N // users: %13, %10 + %14 = alloc_stack $Int, var, name "N" // users: %13, %10 store %13 to %14#1 : $*Int // id: %10 %15 = enum $SimpleEnum, #SimpleEnum.HasInt!enumelt.1, %13 : $Int // user: %14 dealloc_stack %14#0 : $*@local_storage Int // id: %13 diff --git a/test/SILOptimizer/simplify_cfg_args.sil b/test/SILOptimizer/simplify_cfg_args.sil index 25726c7b931..0944389a3da 100644 --- a/test/SILOptimizer/simplify_cfg_args.sil +++ b/test/SILOptimizer/simplify_cfg_args.sil @@ -465,7 +465,7 @@ public enum Numbers { // CHECK_WITH_CODEMOTION: return sil @FormSelectEnumFromTwoSelectSwitches : $@convention(thin) (Numbers) -> Int32 { bb0(%0 : $Numbers): - debug_value %0 : $Numbers // let e // id: %1 + debug_value %0 : $Numbers, let, name "e" // id: %1 switch_enum %0 : $Numbers, case #Numbers.First!enumelt: bb1, case #Numbers.Second!enumelt: bb3, case #Numbers.Third!enumelt: bb4, default bb6 // id: %2 bb1: // Preds: bb0 @@ -542,7 +542,7 @@ bb20(%34 : $Builtin.Int32): // Preds: bb2 bb5 bb11 bb14 bb // CHECK_WITH_CODEMOTION: return sil @FormSelectEnumIntResult : $@convention(thin) (Numbers) -> Int32 { bb0(%0 : $Numbers): - debug_value %0 : $Numbers // let e // id: %1 + debug_value %0 : $Numbers, let, name "e" // id: %1 switch_enum %0 : $Numbers, case #Numbers.First!enumelt: bb1, case #Numbers.Second!enumelt: bb3, case #Numbers.Third!enumelt: bb4, case #Numbers.Fourth!enumelt: bb6, default bb8 // id: %2 bb1: // Preds: bb0 @@ -590,7 +590,7 @@ bb11(%21 : $Builtin.Int32): // Preds: bb2 bb5 bb7 bb10 // CHECK_WITH_CODEMOTION: return sil @FormSelectEnumBoolResult : $@convention(thin) (Numbers) -> Bool { bb0(%0 : $Numbers): - debug_value %0 : $Numbers // let e // id: %1 + debug_value %0 : $Numbers, let, name "e" // id: %1 switch_enum %0 : $Numbers, case #Numbers.First!enumelt: bb1, case #Numbers.Second!enumelt: bb3, case #Numbers.Third!enumelt: bb4, default bb6 // id: %2 bb1: // Preds: bb0 @@ -631,7 +631,7 @@ bb9(%17 : $Builtin.Int1): // Preds: bb2 bb5 bb8 // CHECK_WITH_CODEMOTION: return sil @DontFormSelectEnumBoolResult : $@convention(thin) (Numbers, Bool) -> Bool { bb0(%0 : $Numbers, %1 : $Bool): - debug_value %0 : $Numbers // let e // id: %2 + debug_value %0 : $Numbers, let, name "e" // id: %2 %2 = struct_extract %1 : $Bool, #Bool._value switch_enum %0 : $Numbers, case #Numbers.First!enumelt: bb1, case #Numbers.Second!enumelt: bb3, case #Numbers.Third!enumelt: bb4, default bb6 // id: %4 diff --git a/test/SILOptimizer/specialize.sil b/test/SILOptimizer/specialize.sil index 9956f9c310e..0dee0377703 100644 --- a/test/SILOptimizer/specialize.sil +++ b/test/SILOptimizer/specialize.sil @@ -32,8 +32,8 @@ bb0: // specialize.XXX.init (specialize.XXX.Type)(t : A) -> specialize.XXX sil [noinline] @_TFV10specialize3XXXCU__fMGS0_Q__FT1tQ__GS0_Q__ : $@convention(thin) (@out XXX, @in T, @thin XXX.Type) -> () { bb0(%0 : $*XXX, %1 : $*T, %2 : $@thin XXX.Type): - %3 = alloc_stack $XXX // var self // users: %7, %11, %13 - debug_value_addr %1 : $*T // let t // id: %4 + %3 = alloc_stack $XXX, var, name "sf" // users: %7, %11, %13 + debug_value_addr %1 : $*T, let, name "t" // id: %4 %5 = alloc_stack $T // users: %6, %8, %9 copy_addr %1 to [initialization] %5#1 : $*T // id: %6 %7 = struct_element_addr %3#1 : $*XXX, #XXX.m_t // user: %8 @@ -49,7 +49,7 @@ bb0(%0 : $*XXX, %1 : $*T, %2 : $@thin XXX.Type): // specialize.XXX.foo (@inout specialize.XXX)(t : A) -> Swift.Int32 sil [noinline] @_TFV10specialize3XXX3fooU__fRGS0_Q__FT1tQ__Si : $@convention(method) (@in T, @inout XXX) -> Int32 { bb0(%0 : $*T, %1 : $*XXX): - debug_value_addr %0 : $*T // let t // id: %2 + debug_value_addr %0 : $*T, let, name "t" // id: %2 %3 = alloc_stack $T // users: %4, %6, %7 copy_addr %0 to [initialization] %3#1 : $*T // id: %4 %5 = struct_element_addr %1 : $*XXX, #XXX.m_t // user: %6 @@ -73,7 +73,7 @@ bb0(%0 : $Builtin.Int2048, %1 : $@thin Int32.Type): // specialize.acceptsInt (Swift.Int32) -> () sil [noinline] @_TF10specialize10acceptsIntFSiT_ : $@convention(thin) (Int32) -> () { bb0(%0 : $Int32): - debug_value %0 : $Int32 // let x // id: %1 + debug_value %0 : $Int32, let, name "x" // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } @@ -81,7 +81,7 @@ bb0(%0 : $Int32): // specialize.exp1 () -> () sil @_TF10specialize4exp1FT_T_ : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $XXX // var II // users: %7, %15, %19 + %0 = alloc_stack $XXX, var, name "II" // users: %7, %15, %19 // function_ref specialize.XXX.init (specialize.XXX.Type)(t : A) -> specialize.XXX %1 = function_ref @_TFV10specialize3XXXCU__fMGS0_Q__FT1tQ__GS0_Q__ : $@convention(thin) <τ_0_0> (@out XXX<τ_0_0>, @in τ_0_0, @thin XXX<τ_0_0>.Type) -> () // user: %7 %2 = metatype $@thin XXX.Type // user: %7 @@ -110,7 +110,7 @@ bb0: // specialize.exp2 () -> () sil @_TF10specialize4exp2FT_T_ : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $XXX // var II8 // users: %7, %15, %19 + %0 = alloc_stack $XXX, var, name "I8" // users: %7, %15, %19 // function_ref specialize.XXX.init (specialize.XXX.Type)(t : A) -> specialize.XXX %1 = function_ref @_TFV10specialize3XXXCU__fMGS0_Q__FT1tQ__GS0_Q__ : $@convention(thin) <τ_0_0> (@out XXX<τ_0_0>, @in τ_0_0, @thin XXX<τ_0_0>.Type) -> () // user: %7 %2 = metatype $@thin XXX.Type // user: %7 @@ -152,7 +152,7 @@ bb0(%0 : $Int32, %1 : $@thin UInt8.Type): // specialize.useClosure (fun : () -> A) -> A sil @_TF10specialize10useClosureU__FT3funFT_Q__Q_ : $@convention(thin) (@out T, @owned @callee_owned (@out T) -> ()) -> () { bb0(%0 : $*T, %1 : $@callee_owned (@out T) -> ()): - debug_value %1 : $@callee_owned (@out T) -> () // let fun // id: %2 + debug_value %1 : $@callee_owned (@out T) -> (), let, name "fun" // id: %2 strong_retain %1 : $@callee_owned (@out T) -> () // id: %3 %4 = apply %1(%0) : $@callee_owned (@out T) -> () strong_release %1 : $@callee_owned (@out T) -> () // id: %5 @@ -163,7 +163,7 @@ bb0(%0 : $*T, %1 : $@callee_owned (@out T) -> ()): // specialize.getGenericClosure (t : A) -> () -> A sil @_TF10specialize17getGenericClosureU__FT1tQ__FT_Q_ : $@convention(thin) (@in T) -> @owned @callee_owned (@out T) -> () { bb0(%0 : $*T): - debug_value_addr %0 : $*T // let t // id: %1 + debug_value_addr %0 : $*T, let, name "t" // id: %1 // function_ref specialize.(getGenericClosure (t : A) -> () -> A).(tmp #1) (())A %2 = function_ref @_TFF10specialize17getGenericClosureU__FT1tQ__FT_Q_L_3tmpfT_Q_ : $@convention(thin) <τ_0_0> (@out τ_0_0, @owned @box τ_0_0) -> () // user: %5 %3 = alloc_box $T // users: %4, %5, %5 @@ -186,7 +186,7 @@ bb0(%0 : $*T, %1 : $@box T): // specialize.specializePartialApplies () -> Swift.UInt8 sil @_TF10specialize24specializePartialAppliesFT_Vs5UInt8 : $@convention(thin) () -> UInt8 { bb0: - %0 = alloc_stack $UInt8 // var i // users: %3, %18 + %0 = alloc_stack $UInt8, var, name "i" // users: %3, %18 %1 = integer_literal $Builtin.Int8, 5 // user: %2 %2 = struct $UInt8 (%1 : $Builtin.Int8) // users: %3, %7 store %2 to %0#1 : $*UInt8 // id: %3 @@ -264,7 +264,7 @@ struct C : P { func get() -> Int32 } // test4.C.get (test4.C)() -> Swift.Int32 sil hidden @_TFV5test41C3getfS0_FT_Vs5Int32 : $@convention(method) (C) -> Int32 { bb0(%0 : $C): - debug_value %0 : $C // let self // id: %1 + debug_value %0 : $C, let, name "self" // id: %1 %2 = integer_literal $Builtin.Int32, 1 // user: %3 %3 = struct $Int32 (%2 : $Builtin.Int32) // user: %4 return %3 : $Int32 // id: %4 @@ -273,7 +273,7 @@ bb0(%0 : $C): // test4.C.init (test4.C.Type)() -> test4.C sil hidden [noinline] @_TFV5test41CCfMS0_FT_S0_ : $@convention(thin) (@thin C.Type) -> C { bb0(%0 : $@thin C.Type): - %1 = alloc_stack $C // var self // user: %3 + %1 = alloc_stack $C, var, name "sf" // user: %3 %2 = struct $C () // user: %4 dealloc_stack %1#0 : $*@local_storage C // id: %3 return %2 : $C // id: %4 @@ -292,7 +292,7 @@ bb0(%0 : $*C): // test4.boo (A) -> (Swift.Int32, B) -> Swift.Int32 sil hidden [noinline] @_TF5test43booUS_1P___FQ_FTVs5Int32Q0__S1_ : $@convention(thin) (@in U) -> @owned @callee_owned (Int32, @in T) -> Int32 { bb0(%0 : $*U): - debug_value_addr %0 : $*U // let y // id: %1 + debug_value_addr %0 : $*U, let, name "y" // id: %1 // function_ref test4.(boo (A) -> (Swift.Int32, B) -> Swift.Int32).(closure #1) %2 = function_ref @_TFF5test43booUS_1P___FQ_FTVs5Int32Q0__S1_U_FTS1_Q0__S1_ : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P> (Int32, @in τ_0_1, @owned @box τ_0_0) -> Int32 // user: %5 %3 = alloc_box $U // users: %4, %5, %5 @@ -306,8 +306,8 @@ bb0(%0 : $*U): sil shared [noinline] @_TFF5test43booUS_1P___FQ_FTVs5Int32Q0__S1_U_FTS1_Q0__S1_ : $@convention(thin) (Int32, @in T, @owned @box U) -> Int32 { bb0(%0 : $Int32, %1 : $*T, %2 : $@box U): %3 = project_box %2 : $@box U - debug_value %0 : $Int32 // let x // id: %4 - debug_value_addr %1 : $*T // let z // id: %5 + debug_value %0 : $Int32, let, name "x" // id: %4 + debug_value_addr %1 : $*T, let, name "z" // id: %5 %6 = witness_method $U, #P.get!1 : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int32 // user: %7 %7 = apply %6(%3) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int32 // user: %8 %8 = struct_extract %7 : $Int32, #Int32._value // user: %11 @@ -340,8 +340,8 @@ bb0(%0 : $Int32, %1 : $Int32): // test4.foo (A, B) -> (Swift.Int32, Swift.Float) -> Swift.Int32 sil hidden [noinline] @_TF5test43fooUS_1P_S0___FTQ_Q0__FTVs5Int32Sf_S1_ : $@convention(thin) (@in T, @in U) -> @owned @callee_owned (Int32, Float) -> Int32 { bb0(%0 : $*T, %1 : $*U): - debug_value_addr %0 : $*T // let x // id: %2 - debug_value_addr %1 : $*U // let y // id: %3 + debug_value_addr %0 : $*T, let, name "x" // id: %2 + debug_value_addr %1 : $*U, let, name "y" // id: %3 // function_ref test4.boo (A) -> (Swift.Int32, B) -> Swift.Int32 %4 = function_ref @_TF5test43booUS_1P___FQ_FTVs5Int32Q0__S1_ : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P> (@in τ_0_0) -> @owned @callee_owned (Int32, @in τ_0_1) -> Int32 // user: %7 %5 = alloc_stack $U // users: %6, %7, %10 @@ -369,7 +369,7 @@ bb0(%0 : $Int32, %1 : $Float, %2 : $@callee_owned (Int32, @in Float) -> Int32): // test4.gen1 (A) -> (Swift.Int32) -> Swift.Int32 sil hidden [noinline] @_TF5test44gen1US_1P__FQ_FVs5Int32S1_ : $@convention(thin) (@in T) -> @owned @callee_owned (Int32) -> Int32 { bb0(%0 : $*T): - debug_value_addr %0 : $*T // let x // id: %1 + debug_value_addr %0 : $*T, let, name "x" // id: %1 // function_ref test4.(gen1 (A) -> (Swift.Int32) -> Swift.Int32).(closure #1) %2 = function_ref @_TFF5test44gen1US_1P__FQ_FVs5Int32S1_U_FS1_S1_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (Int32, @owned @box τ_0_0) -> Int32 // user: %5 %3 = alloc_box $T // users: %4, %5, %5 @@ -383,7 +383,7 @@ bb0(%0 : $*T): sil shared [noinline] @_TFF5test44gen1US_1P__FQ_FVs5Int32S1_U_FS1_S1_ : $@convention(thin) (Int32, @owned @box T) -> Int32 { bb0(%0 : $Int32, %1 : $@box T): %2 = project_box %1 : $@box T - debug_value %0 : $Int32 // let $0 // id: %3 + debug_value %0 : $Int32 , let, name "$0" // id: %3 %4 = witness_method $T, #P.get!1 : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int32 // user: %5 %5 = apply %4(%2) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int32 // user: %6 %6 = struct_extract %5 : $Int32, #Int32._value // user: %9 @@ -442,12 +442,12 @@ bb0(%0 : $Int32, %1 : $@box T): // CHECK: function_ref @_TTSg5V4main1CS0_S_1PS__S0_S0_S1_S____TF5test43fooUS_1P_S0___FTQ_Q0__FTVs5Int32Sf_S1_ sil hidden @_TF5test43barFT_Vs5Int32 : $@convention(thin) () -> Int32 { bb0: - %0 = alloc_stack $@callee_owned (Int32, Float) -> Int32 // var f // users: %11, %22 + %0 = alloc_stack $@callee_owned (Int32, Float) -> Int32, var, name "f" // users: %11, %22 // function_ref test4.C.init (test4.C.Type)() -> test4.C %1 = function_ref @_TFV5test41CCfMS0_FT_S0_ : $@convention(thin) (@thin C.Type) -> C // user: %3 %2 = metatype $@thin C.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin C.Type) -> C // users: %4, %7, %9 - debug_value %3 : $C // let c // id: %4 + debug_value %3 : $C, let, name "c" // id: %4 // function_ref test4.foo (A, B) -> (Swift.Int32, Swift.Float) -> Swift.Int32 %5 = function_ref @_TF5test43fooUS_1P_S0___FTQ_Q0__FTVs5Int32Sf_S1_ : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P, τ_0_1 : P> (@in τ_0_0, @in τ_0_1) -> @owned @callee_owned (Int32, Float) -> Int32 // user: %10 %6 = alloc_stack $C // users: %7, %10, %13 @@ -488,12 +488,12 @@ bb0: // CHECK: function_ref @_TTSg5V4main1CS0_S_1PS____TF5test44gen1US_1P__FQ_FVs5Int32S1_ : $@convention(thin) (@in C) -> @owned @callee_owned (Int32) -> Int32 sil @_TF5test48testGen1FT_Vs5Int32 : $@convention(thin) () -> Int32 { bb0: - %0 = alloc_stack $@callee_owned (Int32) -> Int32 // var f // users: %9, %16 + %0 = alloc_stack $@callee_owned (Int32) -> Int32, var, name "f" // users: %9, %16 // function_ref test4.C.init (test4.C.Type)() -> test4.C %1 = function_ref @_TFV5test41CCfMS0_FT_S0_ : $@convention(thin) (@thin C.Type) -> C // user: %3 %2 = metatype $@thin C.Type // user: %3 %3 = apply %1(%2) : $@convention(thin) (@thin C.Type) -> C // users: %4, %7 - debug_value %3 : $C // let c // id: %4 + debug_value %3 : $C, let, name "c" // id: %4 // function_ref test4.gen1 (A) -> (Swift.Int32) -> Swift.Int32 %5 = function_ref @_TF5test44gen1US_1P__FQ_FVs5Int32S1_ : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in τ_0_0) -> @owned @callee_owned (Int32) -> Int32 // user: %8 %6 = alloc_stack $C // users: %7, %8, %10 diff --git a/test/SILOptimizer/specialize_recursive_generics.sil b/test/SILOptimizer/specialize_recursive_generics.sil index 8501b1b2439..718d63811ac 100644 --- a/test/SILOptimizer/specialize_recursive_generics.sil +++ b/test/SILOptimizer/specialize_recursive_generics.sil @@ -14,7 +14,7 @@ import Swift // CHECK: return sil [noinline] @_TF29specialize_recursive_generics18recursive_genericsU__FQ_T_ : $@convention(thin) (@in T) -> () { bb0(%0 : $*T): - debug_value_addr %0 : $*T // let t // id: %1 + debug_value_addr %0 : $*T, let, name "t" // id: %1 // function_ref specialize_recursive_generics.recursive_generics (A) -> () %2 = function_ref @_TF29specialize_recursive_generics18recursive_genericsU__FQ_T_ : $@convention(thin) <τ_0_0> (@in τ_0_0) -> () // user: %5 %3 = alloc_stack $T // users: %4, %5, %6 @@ -39,8 +39,8 @@ bb0(%0 : $*T): sil [noinline] @_TF29specialize_recursive_generics47recursive_generics_with_different_substitutionsU___FTQ_Q0__T_ : $@convention(thin) (@in T, @in U) -> () { bb0(%0 : $*T, %1 : $*U): - debug_value_addr %0 : $*T // let t // id: %2 - debug_value_addr %1 : $*U // let u // id: %3 + debug_value_addr %0 : $*T, let, name "t" // id: %2 + debug_value_addr %1 : $*U, let, name "u" // id: %3 // function_ref specialize_recursive_generics.recursive_generics_with_different_substitutions (A, B) -> () %4 = function_ref @_TF29specialize_recursive_generics47recursive_generics_with_different_substitutionsU___FTQ_Q0__T_ : $@convention(thin) <τ_0_0, τ_0_1> (@in τ_0_0, @in τ_0_1) -> () // user: %9 %5 = alloc_stack $U // users: %6, %9, %11 diff --git a/test/SILOptimizer/typed-access-tb-aa.sil b/test/SILOptimizer/typed-access-tb-aa.sil index 86ba7679a8e..81f7544cb92 100644 --- a/test/SILOptimizer/typed-access-tb-aa.sil +++ b/test/SILOptimizer/typed-access-tb-aa.sil @@ -39,8 +39,8 @@ sil @goo_init : $@convention(thin) (@thick goo.Type) -> @owned goo // CHECK: NoAlias sil hidden @no_parent_child_relation_reftype_tests : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $boo // var a // users: %5, %14 - %1 = alloc_stack $baz // var b // users: %9, %13 + %0 = alloc_stack $boo, var, name "a" // users: %5, %14 + %1 = alloc_stack $baz, var, name "b" // users: %9, %13 %2 = function_ref @boo_init : $@convention(thin) (@thick boo.Type) -> @owned boo // user: %4 %3 = metatype $@thick boo.Type // user: %4 %4 = apply %2(%3) : $@convention(thin) (@thick boo.Type) -> @owned boo // users: %5, %11 @@ -65,8 +65,8 @@ bb0: // CHECK: MayAlias sil hidden @with_parent_child_relation_reftype_tests : $@convention(thin) () -> () { bb0: - %0 = alloc_stack $boo // var a // users: %5, %14 - %1 = alloc_stack $goo // var b // users: %9, %13 + %0 = alloc_stack $boo, var, name "a" // users: %5, %14 + %1 = alloc_stack $goo, var, name "b" // users: %9, %13 %2 = function_ref @boo_init : $@convention(thin) (@thick boo.Type) -> @owned boo // user: %4 %3 = metatype $@thick boo.Type // user: %4 %4 = apply %2(%3) : $@convention(thin) (@thick boo.Type) -> @owned boo // users: %5, %11