diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 86fb0cfdae1..1a45e371b14 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -3396,6 +3396,7 @@ public: CanType getBoxedType() const; // In SILType.h SILType getBoxedAddressType() const; + SILType getFieldType(unsigned index) const; static bool classof(const TypeBase *T) { return T->getKind() == TypeKind::SILBox; diff --git a/include/swift/SIL/Projection.h b/include/swift/SIL/Projection.h index de59e30dade..085348aeb56 100644 --- a/include/swift/SIL/Projection.h +++ b/include/swift/SIL/Projection.h @@ -294,8 +294,7 @@ public: case ProjectionKind::Enum: return BaseType.getEnumElementType(getEnumElementDecl(BaseType), M); case ProjectionKind::Box: - return SILType::getPrimitiveAddressType(BaseType.castTo()-> - getBoxedType()); + return BaseType.castTo()->getFieldType(getIndex()); case ProjectionKind::Tuple: return BaseType.getTupleElementType(getIndex()); case ProjectionKind::Upcast: diff --git a/include/swift/SIL/SILBuilder.h b/include/swift/SIL/SILBuilder.h index ca94afbeff7..51b0276f14a 100644 --- a/include/swift/SIL/SILBuilder.h +++ b/include/swift/SIL/SILBuilder.h @@ -1226,17 +1226,13 @@ public: return insert(new (F.getModule()) ProjectValueBufferInst( getSILDebugLocation(Loc), valueType, operand)); } - ProjectBoxInst *createProjectBox(SILLocation Loc, SILValue boxOperand) { - auto valueTy = - boxOperand->getType().castTo()->getBoxedAddressType(); + ProjectBoxInst *createProjectBox(SILLocation Loc, SILValue boxOperand, + unsigned index) { + auto boxTy = boxOperand->getType().castTo(); + auto fieldTy = boxTy->getFieldType(index); return insert(new (F.getModule()) ProjectBoxInst( - getSILDebugLocation(Loc), valueTy, boxOperand)); - } - ProjectBoxInst *createProjectBox(SILLocation Loc, SILType valueTy, - SILValue boxOperand) { - return insert(new (F.getModule()) ProjectBoxInst( - getSILDebugLocation(Loc), valueTy, boxOperand)); + getSILDebugLocation(Loc), boxOperand, index, fieldTy)); } ProjectExistentialBoxInst *createProjectExistentialBox(SILLocation Loc, SILType valueTy, diff --git a/include/swift/SIL/SILCloner.h b/include/swift/SIL/SILCloner.h index c7462e9a7e1..3406fe006bb 100644 --- a/include/swift/SIL/SILCloner.h +++ b/include/swift/SIL/SILCloner.h @@ -1739,8 +1739,8 @@ void SILCloner::visitProjectBoxInst(ProjectBoxInst *Inst) { getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope())); doPostProcess(Inst, getBuilder().createProjectBox(getOpLocation(Inst->getLoc()), - getOpType(Inst->getValueType()), - getOpValue(Inst->getOperand()))); + getOpValue(Inst->getOperand()), + Inst->getFieldIndex())); } template @@ -1749,7 +1749,7 @@ void SILCloner::visitProjectExistentialBoxInst( getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope())); doPostProcess(Inst, getBuilder().createProjectExistentialBox(getOpLocation(Inst->getLoc()), - getOpType(Inst->getValueType()), + getOpType(Inst->getType()), getOpValue(Inst->getOperand()))); } diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 7f6b989eee5..ed75bd2891d 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -4409,12 +4409,18 @@ class ProjectBoxInst : SILInstruction, /*HasResult*/ true> { friend SILBuilder; - ProjectBoxInst(SILDebugLocation DebugLoc, SILType valueType, - SILValue operand) - : UnaryInstructionBase(DebugLoc, operand, valueType.getAddressType()) {} + unsigned Index; + + ProjectBoxInst(SILDebugLocation DebugLoc, + SILValue operand, + unsigned fieldIndex, + SILType fieldTy) + : UnaryInstructionBase(DebugLoc, operand, fieldTy.getAddressType()), + Index(fieldIndex) {} + public: - SILType getValueType() const { return getType().getObjectType(); } + unsigned getFieldIndex() const { return Index; } }; /// Project out the address of the value in an existential box. @@ -4426,9 +4432,6 @@ class ProjectExistentialBoxInst : ProjectExistentialBoxInst(SILDebugLocation DebugLoc, SILType valueType, SILValue operand) : UnaryInstructionBase(DebugLoc, operand, valueType.getAddressType()) {} - -public: - SILType getValueType() const { return getType().getObjectType(); } }; //===----------------------------------------------------------------------===// diff --git a/include/swift/SIL/SILLayout.h b/include/swift/SIL/SILLayout.h index a209495aa63..8f10fba0c6c 100644 --- a/include/swift/SIL/SILLayout.h +++ b/include/swift/SIL/SILLayout.h @@ -149,6 +149,17 @@ public: } }; +inline SILType SILBoxType::getFieldType(unsigned index) const { + auto fieldTy = getLayout()->getFields()[index].getLoweredType(); + // Apply generic arguments if the layout is generic. + if (!getGenericArgs().empty()) { + auto substMap = + getLayout()->getGenericSignature()->getSubstitutionMap(getGenericArgs()); + fieldTy = fieldTy.subst(substMap)->getCanonicalType(); + } + return SILType::getPrimitiveAddressType(fieldTy); +} + } // end namespace swift #endif // SWIFT_SIL_LAYOUT_H diff --git a/include/swift/SILOptimizer/Utils/Local.h b/include/swift/SILOptimizer/Utils/Local.h index 4b80b6173ae..2685416b0d5 100644 --- a/include/swift/SILOptimizer/Utils/Local.h +++ b/include/swift/SILOptimizer/Utils/Local.h @@ -130,7 +130,7 @@ bool canCastValueToABICompatibleType(SILModule &M, /// Returns a project_box if it is the next instruction after \p ABI and /// and has \p ABI as operand. Otherwise it creates a new project_box right /// after \p ABI and returns it. -ProjectBoxInst *getOrCreateProjectBox(AllocBoxInst *ABI); +ProjectBoxInst *getOrCreateProjectBox(AllocBoxInst *ABI, unsigned Index); /// Replace an apply with an instruction that produces the same value, /// then delete the apply and the instructions that produce its callee diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 19b8ea3445d..69b7c5527ef 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -4030,7 +4030,8 @@ CanGenericSignature ASTContext::getSingleGenericParameterSignature() const { return theSig; auto param = GenericTypeParamType::get(0, 0, *this); - auto sig = GenericSignature::get(param, {}); + auto witnessReqt = Requirement(RequirementKind::WitnessMarker, param, Type()); + auto sig = GenericSignature::get(param, witnessReqt);; auto canonicalSig = CanGenericSignature(sig); Impl.SingleGenericParameterSignature = canonicalSig; return canonicalSig; diff --git a/lib/Parse/ParseSIL.cpp b/lib/Parse/ParseSIL.cpp index 117bcd0addb..6e2a87c8e90 100644 --- a/lib/Parse/ParseSIL.cpp +++ b/lib/Parse/ParseSIL.cpp @@ -1755,9 +1755,24 @@ bool SILParser::parseSILInstruction(SILBasicBlock *BB, SILBuilder &B) { case ValueKind::ProjectBoxInst: { if (parseTypedValueRef(Val, B) || - parseSILDebugLocation(InstLoc, B)) + P.parseToken(tok::comma, diag::expected_tok_in_sil_instr, ",")) return true; - ResultVal = B.createProjectBox(InstLoc, Val); + + if (!P.Tok.is(tok::integer_literal)) { + P.diagnose(P.Tok, diag::expected_tok_in_sil_instr, "integer"); + return true; + } + + unsigned Index; + bool error = P.Tok.getText().getAsInteger(0, Index); + assert(!error && "project_box index did not parse as integer?!"); + (void)error; + + P.consumeToken(tok::integer_literal); + if (parseSILDebugLocation(InstLoc, B)) + return true; + + ResultVal = B.createProjectBox(InstLoc, Val, Index); break; } diff --git a/lib/SIL/Projection.cpp b/lib/SIL/Projection.cpp index 6e01f5d4daa..5a1667a46d4 100644 --- a/lib/SIL/Projection.cpp +++ b/lib/SIL/Projection.cpp @@ -263,7 +263,7 @@ Projection::createAddressProjection(SILBuilder &B, SILLocation Loc, case ProjectionKind::TailElems: return B.createRefTailAddr(Loc, Base, getCastType(BaseTy)); case ProjectionKind::Box: - return B.createProjectBox(Loc, Base); + return B.createProjectBox(Loc, Base, getIndex()); case ProjectionKind::Upcast: return B.createUpcast(Loc, Base, getCastType(BaseTy)); case ProjectionKind::RefCast: diff --git a/lib/SIL/SILPrinter.cpp b/lib/SIL/SILPrinter.cpp index 507c240f62a..45f63c046f2 100644 --- a/lib/SIL/SILPrinter.cpp +++ b/lib/SIL/SILPrinter.cpp @@ -1528,10 +1528,11 @@ public: *this << PVBI->getValueType() << " in " << getIDAndType(PVBI->getOperand()); } void visitProjectBoxInst(ProjectBoxInst *PBI) { - *this << getIDAndType(PBI->getOperand()); + *this << getIDAndType(PBI->getOperand()) << ", " << PBI->getFieldIndex(); } void visitProjectExistentialBoxInst(ProjectExistentialBoxInst *PEBI) { - *this << PEBI->getValueType() << " in " << getIDAndType(PEBI->getOperand()); + *this << PEBI->getType().getObjectType() + << " in " << getIDAndType(PEBI->getOperand()); } void visitCondFailInst(CondFailInst *FI) { diff --git a/lib/SIL/SILType.cpp b/lib/SIL/SILType.cpp index 0ddc9f66bb1..d1b8be4e822 100644 --- a/lib/SIL/SILType.cpp +++ b/lib/SIL/SILType.cpp @@ -583,15 +583,17 @@ CanSILBoxType SILBoxType::get(CanType boxedType) { } SILBoxType::SILBoxType(ASTContext &C, - SILLayout *Layout, ArrayRef Params) + SILLayout *Layout, ArrayRef Args) : TypeBase(TypeKind::SILBox, &C, - getRecursivePropertiesFromSubstitutions(Params)), + getRecursivePropertiesFromSubstitutions(Args)), Layout(Layout), - NumGenericArgs(Params.size()) + NumGenericArgs(Args.size()) { + // Check that the generic args are reasonable for the box's signature. + assert((Layout->getGenericSignature()->getSubstitutionMap(Args), true)); auto paramsBuf = getTrailingObjects(); for (unsigned i = 0; i < NumGenericArgs; ++i) - ::new (paramsBuf + i) Substitution(Params[i]); + ::new (paramsBuf + i) Substitution(Args[i]); } RecursiveTypeProperties SILBoxType:: @@ -605,10 +607,7 @@ getRecursivePropertiesFromSubstitutions(ArrayRef Params) { /// TODO: Transitional accessor for single-type boxes. CanType SILBoxType::getBoxedType() const { - auto layout = getLayout(); - assert(layout->getFields().size() == 1 - && layout->getGenericSignature()->getGenericParams().size() == 1 - && layout->getFields()[0].getLoweredType()->is() + assert(getLayout()->getFields().size() == 1 && "is not a single-field box"); - return CanType(getGenericArgs()[0].getReplacement()); + return getFieldType(0).getSwiftRValueType(); } diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index b56a230a9d8..4adb534a931 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -3846,7 +3846,7 @@ ManagedValue SILGenFunction::emitInjectEnum(SILLocation loc, if (element->isIndirect() || element->getParentEnum()->isIndirect()) { auto *box = B.createAllocBox(loc, payloadTL.getLoweredType()); - auto *addr = B.createProjectBox(loc, box); + auto *addr = B.createProjectBox(loc, box, 0); CleanupHandle initCleanup = enterDestroyCleanup(box); Cleanups.setCleanupState(initCleanup, CleanupState::Dormant); diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index f7fc1641017..9ff9ceeb885 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -286,7 +286,7 @@ public: // it using a box. AllocBoxInst *allocBox = SGF.B.createAllocBox(decl, lType, {decl->isLet(), ArgNo}); - SILValue addr = SGF.B.createProjectBox(decl, allocBox); + SILValue addr = SGF.B.createProjectBox(decl, allocBox, 0); // Mark the memory as uninitialized, so DI will track it for us. if (NeedsMarkUninit) @@ -723,7 +723,7 @@ emitEnumMatch(ManagedValue value, EnumElementDecl *ElementDecl, // If the payload is indirect, project it out of the box. if (ElementDecl->isIndirect() || ElementDecl->getParentEnum()->isIndirect()) { - SILValue boxedValue = SGF.B.createProjectBox(loc, eltMV.getValue()); + SILValue boxedValue = SGF.B.createProjectBox(loc, eltMV.getValue(), 0); auto &boxedTL = SGF.getTypeLowering(boxedValue->getType()); if (boxedTL.isLoadable()) boxedValue = SGF.B.createLoad(loc, boxedValue); diff --git a/lib/SILGen/SILGenFunction.cpp b/lib/SILGen/SILGenFunction.cpp index e94b96e0d49..3b82db298f6 100644 --- a/lib/SILGen/SILGenFunction.cpp +++ b/lib/SILGen/SILGenFunction.cpp @@ -338,7 +338,7 @@ void SILGenFunction::emitCaptures(SILLocation loc, // in-place. AllocBoxInst *allocBox = B.createAllocBox(loc, vl.value->getType().getObjectType()); - ProjectBoxInst *boxAddress = B.createProjectBox(loc, allocBox); + ProjectBoxInst *boxAddress = B.createProjectBox(loc, allocBox, 0); B.createCopyAddr(loc, vl.value, boxAddress, IsNotTake,IsInitialization); capturedArgs.push_back(emitManagedRValueWithCleanup(allocBox)); } diff --git a/lib/SILGen/SILGenPattern.cpp b/lib/SILGen/SILGenPattern.cpp index 3491eea7df6..c4fa0416d71 100644 --- a/lib/SILGen/SILGenPattern.cpp +++ b/lib/SILGen/SILGenPattern.cpp @@ -1773,7 +1773,7 @@ emitEnumElementDispatch(ArrayRef rows, // If the payload is boxed, project it. if (elt->isIndirect() || elt->getParentEnum()->isIndirect()) { - SILValue boxedValue = SGF.B.createProjectBox(loc, origCMV.getValue()); + SILValue boxedValue = SGF.B.createProjectBox(loc, origCMV.getValue(), 0); eltTL = &SGF.getTypeLowering(boxedValue->getType()); if (eltTL->isLoadable()) boxedValue = SGF.B.createLoad(loc, boxedValue); diff --git a/lib/SILGen/SILGenProlog.cpp b/lib/SILGen/SILGenProlog.cpp index 6e2544e8fef..742804b87c4 100644 --- a/lib/SILGen/SILGenProlog.cpp +++ b/lib/SILGen/SILGenProlog.cpp @@ -390,7 +390,7 @@ static void emitCaptureArguments(SILGenFunction &gen, CapturedValue capture, SILType boxTy = SILType::getPrimitiveObjectType( SILBoxType::get(ty.getSwiftRValueType())); SILValue box = new (gen.SGM.M) SILArgument(gen.F.begin(), boxTy, VD); - SILValue addr = gen.B.createProjectBox(VD, box); + SILValue addr = gen.B.createProjectBox(VD, box, 0); gen.VarLocs[VD] = SILGenFunction::VarLoc::get(addr, box); gen.B.createDebugValueAddr(Loc, addr, {/*Constant*/false, ArgNo}); if (!gen.SGM.M.getOptions().EnableGuaranteedClosureContexts) diff --git a/lib/SILOptimizer/IPO/CapturePromotion.cpp b/lib/SILOptimizer/IPO/CapturePromotion.cpp index b5b08337f32..b5a20720872 100644 --- a/lib/SILOptimizer/IPO/CapturePromotion.cpp +++ b/lib/SILOptimizer/IPO/CapturePromotion.cpp @@ -949,7 +949,7 @@ processPartialApplyInst(PartialApplyInst *PAI, IndicesSet &PromotableIndices, // alloc_box. This makes sure that the project_box dominates the // partial_apply. if (!Addr) - Addr = getOrCreateProjectBox(ABI); + Addr = getOrCreateProjectBox(ABI, 0); auto &typeLowering = M.getTypeLowering(Addr->getType()); Args.push_back( diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index 2e285aea91b..70076ae5d0f 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -1774,7 +1774,7 @@ void LifetimeChecker::processUninitializedRelease(SILInstruction *Release, // since the pointer it contains will be manually cleaned up. auto *ABI = dyn_cast(Release->getOperand(0)); if (ABI) - Pointer = getOrCreateProjectBox(ABI); + Pointer = getOrCreateProjectBox(ABI, 0); if (!consumed) { if (Pointer->getType().isAddress()) diff --git a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp index 20daafed4aa..937071c303f 100644 --- a/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp +++ b/lib/SILOptimizer/Transforms/AllocBoxToStack.cpp @@ -732,7 +732,7 @@ specializePartialApply(PartialApplyInst *PartialApply, // alloc_box. This makes sure that the project_box dominates the // partial_apply. if (!promoted) - promoted = getOrCreateProjectBox(box); + promoted = getOrCreateProjectBox(box, 0); Args.push_back(promoted); diff --git a/lib/SILOptimizer/Utils/Local.cpp b/lib/SILOptimizer/Utils/Local.cpp index 8088b17bcbe..92f142c079b 100644 --- a/lib/SILOptimizer/Utils/Local.cpp +++ b/lib/SILOptimizer/Utils/Local.cpp @@ -753,19 +753,19 @@ bool swift::canCastValueToABICompatibleType(SILModule &M, return Result.hasValue(); } -ProjectBoxInst *swift::getOrCreateProjectBox(AllocBoxInst *ABI) { +ProjectBoxInst *swift::getOrCreateProjectBox(AllocBoxInst *ABI, unsigned Index){ SILBasicBlock::iterator Iter(ABI); Iter++; assert(Iter != ABI->getParent()->end() && "alloc_box cannot be the last instruction of a block"); SILInstruction *NextInst = &*Iter; if (auto *PBI = dyn_cast(NextInst)) { - if (PBI->getOperand() == ABI) + if (PBI->getOperand() == ABI && PBI->getFieldIndex() == Index) return PBI; } SILBuilder B(NextInst); - return B.createProjectBox(ABI->getLoc(), ABI); + return B.createProjectBox(ABI->getLoc(), ABI, Index); } //===----------------------------------------------------------------------===// diff --git a/lib/Serialization/DeserializeSIL.cpp b/lib/Serialization/DeserializeSIL.cpp index 2378e46e8d2..cd81a31a371 100644 --- a/lib/Serialization/DeserializeSIL.cpp +++ b/lib/Serialization/DeserializeSIL.cpp @@ -802,7 +802,6 @@ bool SILDeserializer::readSILInstruction( ONETYPE_ONEOPERAND_INST(ExistentialMetatype) ONETYPE_ONEOPERAND_INST(AllocValueBuffer) ONETYPE_ONEOPERAND_INST(ProjectValueBuffer) - ONETYPE_ONEOPERAND_INST(ProjectBox) ONETYPE_ONEOPERAND_INST(ProjectExistentialBox) ONETYPE_ONEOPERAND_INST(DeallocValueBuffer) #undef ONETYPE_ONEOPERAND_INST @@ -846,6 +845,17 @@ bool SILDeserializer::readSILInstruction( ONEOPERAND_ONETYPE_INST(ProjectBlockStorage) #undef ONEOPERAND_ONETYPE_INST + case ValueKind::ProjectBoxInst: { + assert(RecordKind == SIL_ONE_TYPE_ONE_OPERAND && + "Layout should be OneTypeOneOperand."); + ResultVal = Builder.createProjectBox(Loc, + getLocalValue(ValID, + getSILType(MF->getType(TyID2), + (SILValueCategory)TyCategory2)), + TyID); + break; + } + case ValueKind::PointerToAddressInst: { assert(RecordKind == SIL_ONE_TYPE_ONE_OPERAND && "Layout should be OneTypeOneOperand."); diff --git a/lib/Serialization/SerializeSIL.cpp b/lib/Serialization/SerializeSIL.cpp index 96aa7c4021c..ed299011cfc 100644 --- a/lib/Serialization/SerializeSIL.cpp +++ b/lib/Serialization/SerializeSIL.cpp @@ -692,21 +692,31 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) { case ValueKind::ProjectValueBufferInst: { auto PVBI = cast(&SI); writeOneTypeOneOperandLayout(PVBI->getKind(), 0, - PVBI->getValueType(), + PVBI->getType(), PVBI->getOperand()); break; } case ValueKind::ProjectBoxInst: { auto PBI = cast(&SI); - writeOneTypeOneOperandLayout(PBI->getKind(), 0, - PBI->getValueType(), - PBI->getOperand()); + + // Use SILOneTypeOneOperandLayout with the field index crammed in the TypeID + auto boxOperand = PBI->getOperand(); + auto boxRef = addValueRef(boxOperand); + auto boxType = boxOperand->getType(); + auto boxTypeRef = S.addTypeRef(boxType.getSwiftRValueType()); + + SILOneTypeOneOperandLayout::emitRecord(Out, ScratchRecord, + SILAbbrCodes[SILOneTypeOneOperandLayout::Code], + unsigned(PBI->getKind()), 0, + PBI->getFieldIndex(), 0, + boxTypeRef, unsigned(boxType.getCategory()), + boxRef); break; } case ValueKind::ProjectExistentialBoxInst: { auto PEBI = cast(&SI); writeOneTypeOneOperandLayout(PEBI->getKind(), 0, - PEBI->getValueType(), + PEBI->getType(), PEBI->getOperand()); break; } diff --git a/test/IRGen/dynamic_lookup.sil b/test/IRGen/dynamic_lookup.sil index 2714a5d8e77..a6d55eec089 100644 --- a/test/IRGen/dynamic_lookup.sil +++ b/test/IRGen/dynamic_lookup.sil @@ -55,7 +55,7 @@ bb0(%0 : $X): sil @dynamic_lookup_br : $@convention(thin) (AnyObject) -> () { bb0(%0 : $AnyObject): %1 = alloc_box $AnyObject - %1a = project_box %1 : $@box AnyObject + %1a = project_box %1 : $@box AnyObject, 0 store %0 to %1a : $*AnyObject %3 = alloc_box $Optional<() -> ()> %4 = load %1a : $*AnyObject @@ -104,7 +104,7 @@ bb3: sil @_T1t23dynamic_lookup_propertyFT1xPSo13AnyObject__T_ : $@convention(thin) (AnyObject) -> () { bb0(%0 : $AnyObject): %1 = alloc_box $AnyObject - %1a = project_box %1 : $@box AnyObject + %1a = project_box %1 : $@box AnyObject, 0 store %0 to %1a : $*AnyObject %6 = load %1a : $*AnyObject // users: %24, %8, %7 strong_retain %6 : $AnyObject @@ -127,9 +127,9 @@ bb3: sil @_T1t16opt_to_subscriptFT3objPSo13AnyObject_1iSi_T_ : $@convention(thin) (AnyObject, Int) -> () { bb0(%0 : $AnyObject, %1 : $Int): %2 = alloc_box $AnyObject - %2a = project_box %2 : $@box AnyObject + %2a = project_box %2 : $@box AnyObject, 0 %3 = alloc_box $Int - %3a = project_box %3 : $@box Int + %3a = project_box %3 : $@box Int, 0 store %0 to %2a : $*AnyObject store %1 to %3a : $*Int %8 = load %2a : $*AnyObject diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index 0c5a786145f..02aec159f98 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -560,7 +560,7 @@ entry: // CHECK: store %swift.refcounted* null // CHECK: store %swift.opaque* undef %b = alloc_box $() - %ba = project_box %b : $@box () + %ba = project_box %b : $@box (), 0 %f = function_ref @partial_empty_box : $@convention(thin) (@owned @box (), @inout ()) -> () %g = partial_apply %f(%b, %ba) : $@convention(thin) (@owned @box (), @inout ()) -> () return undef : $() diff --git a/test/IRGen/typed_boxes.sil b/test/IRGen/typed_boxes.sil index d0d86e823a2..f87c4cc3252 100644 --- a/test/IRGen/typed_boxes.sil +++ b/test/IRGen/typed_boxes.sil @@ -14,7 +14,7 @@ entry: // CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]]* // CHECK-64: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], [[POD_8_8_LAYOUT]]* [[BOX_RAW]], i32 0, i32 1 // CHECK: [[BOX_DATA_1:%.*]] = bitcast [8 x i8]* [[BOX_DATA]] to i64* - %b = project_box %a : $@box Builtin.Int64 + %b = project_box %a : $@box Builtin.Int64, 0 // CHECK: call void @swift_rt_swift_deallocObject(%swift.refcounted* [[BOX]], [[WORD]] 24, [[WORD]] 7) dealloc_box %a : $@box Builtin.Int64 return undef : $() @@ -30,7 +30,7 @@ entry: // CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]]* // CHECK-64: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], [[POD_8_8_LAYOUT]]* [[BOX_RAW]], i32 0, i32 1 // CHECK: [[BOX_DATA_1:%.*]] = bitcast [8 x i8]* [[BOX_DATA]] to double* - %b = project_box %a : $@box Builtin.FPIEEE64 + %b = project_box %a : $@box Builtin.FPIEEE64, 0 // CHECK: call void @swift_rt_swift_deallocObject(%swift.refcounted* [[BOX]], [[WORD]] 24, [[WORD]] 7) dealloc_box %a : $@box Builtin.FPIEEE64 return undef : $() @@ -50,7 +50,7 @@ entry: // CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* [[BOX]] to [[POD_32_32_LAYOUT:<\{ %swift.refcounted, \[16 x i8\], \[32 x i8\] \}>]]* // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_32_32_LAYOUT]], [[POD_32_32_LAYOUT]]* [[BOX_RAW]], i32 0, i32 2 // CHECK: [[BOX_DATA_1:%.*]] = bitcast [32 x i8]* [[BOX_DATA]] to %V11typed_boxes11OverAligned* - %b = project_box %a : $@box OverAligned + %b = project_box %a : $@box OverAligned, 0 // CHECK: call void @swift_rt_swift_deallocObject(%swift.refcounted* [[BOX]], [[WORD]] 64, [[WORD]] 31) dealloc_box %a : $@box OverAligned return undef : $() @@ -69,7 +69,7 @@ entry: // CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 24, [[WORD]] 7) %a = alloc_box $C // CHECK: bitcast %swift.refcounted** {{%.*}} to %C11typed_boxes1C** - %b = project_box %a : $@box C + %b = project_box %a : $@box C, 0 dealloc_box %a : $@box C return undef : $() } @@ -82,7 +82,7 @@ entry: // CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[NATIVE_RC_METADATA]], {{.*}} [[WORD]] 24, [[WORD]] 7) %a = alloc_box $D // CHECK: bitcast %swift.refcounted** {{%.*}} to %C11typed_boxes1D** - %b = project_box %a : $@box D + %b = project_box %a : $@box D, 0 dealloc_box %a : $@box D return undef : $() } @@ -93,7 +93,7 @@ entry: // CHECK-32: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[UNKNOWN_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 16, [[WORD]] 3) // CHECK-64: [[BOX:%.*]] = call noalias %swift.refcounted* @swift_rt_swift_allocObject(%swift.type* {{.*}} [[UNKNOWN_RC_METADATA:@metadata[0-9.]*]], {{.*}} [[WORD]] 24, [[WORD]] 7) %a = alloc_box $Builtin.UnknownObject - %b = project_box %a : $@box Builtin.UnknownObject + %b = project_box %a : $@box Builtin.UnknownObject, 0 dealloc_box %a : $@box Builtin.UnknownObject return undef : $() } @@ -107,7 +107,7 @@ struct Fixed { sil @fixed_box : $@convention(thin) () -> () { entry: %a = alloc_box $Fixed - %b = project_box %a : $@box Fixed + %b = project_box %a : $@box Fixed, 0 dealloc_box %a : $@box Fixed return undef : $() } @@ -130,7 +130,7 @@ entry: // CHECK: [[PTR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 1 %a = alloc_box $Dyn // CHECK: [[CAST_PTR:%.*]] = bitcast %swift.opaque* [[PTR]] to %V11typed_boxes3Dyn* - %b = project_box %a : $@box Dyn + %b = project_box %a : $@box Dyn, 0 %f = function_ref @take_dyn : $@convention(thin) (@in Dyn) -> () // CHECK: call void @take_dyn(%V11typed_boxes3Dyn* {{[^,]*}} [[CAST_PTR]], {{.*}}) %t = apply %f(%b) : $@convention(thin) (@in Dyn) -> () @@ -146,7 +146,7 @@ entry: // CHECK: [[BOX:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 0 // CHECK: [[PTR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[ALLOC]], 1 %a = alloc_box $T - %b = project_box %a : $@box T + %b = project_box %a : $@box T, 0 %f = function_ref @take_t : $@convention(thin) (@in T) -> () // CHECK: call void @take_t(%swift.opaque* {{[^,]*}} [[PTR]], {{.*}}) %t = apply %f(%b) : $@convention(thin) (@in T) -> () @@ -163,7 +163,7 @@ entry(%0 : $@box Builtin.Int64): // CHECK-64: [[BOX_RAW:%.*]] = bitcast %swift.refcounted* %0 to [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]]* // CHECK-64: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], [[POD_8_8_LAYOUT]]* [[BOX_RAW]], i32 0, i32 1 // CHECK: [[BOX_DATA_1:%.*]] = bitcast [8 x i8]* [[BOX_DATA]] to i64* - %p = project_box %0 : $@box Builtin.Int64 + %p = project_box %0 : $@box Builtin.Int64, 0 // CHECK: [[R:%.*]] = load i64, i64* [[BOX_DATA_1]] %l = load %p : $*Builtin.Int64 // CHECK: ret i64 [[R]] @@ -175,7 +175,7 @@ sil @dyn_proj_box_a : $@convention(thin) (@box Dyn) -> () { entry(%0 : $@box Dyn): // CHECK: [[PTR:%.*]] = call %swift.opaque* @swift_projectBox(%swift.refcounted* %0) // CHECK: [[BOX_DATA_1:%.*]] = bitcast %swift.opaque* [[PTR]] to %V11typed_boxes3Dyn* - %p = project_box %0 : $@box Dyn + %p = project_box %0 : $@box Dyn, 0 %f = function_ref @take_dyn : $@convention(thin) (@in Dyn) -> () // CHECK: call void @take_dyn(%V11typed_boxes3Dyn* {{[^,]*}} [[BOX_DATA_1]], {{.*}}) %t = apply %f(%p) : $@convention(thin) (@in Dyn) -> () @@ -187,7 +187,7 @@ entry(%0 : $@box Dyn): sil @dyn_proj_box_b : $@convention(thin) (@box T) -> () { entry(%0 : $@box T): // CHECK: [[PTR:%.*]] = call %swift.opaque* @swift_projectBox(%swift.refcounted* %0) - %p = project_box %0 : $@box T + %p = project_box %0 : $@box T, 0 %f = function_ref @take_t : $@convention(thin) (@in T) -> () // CHECK: call void @take_t(%swift.opaque* {{[^,]*}} [[PTR]], {{.*}}) %t = apply %f(%p) : $@convention(thin) (@in T) -> () diff --git a/test/SIL/Parser/apply_with_substitution.sil b/test/SIL/Parser/apply_with_substitution.sil index 25488e744ea..f2a3ba1f8b6 100644 --- a/test/SIL/Parser/apply_with_substitution.sil +++ b/test/SIL/Parser/apply_with_substitution.sil @@ -10,7 +10,7 @@ import Swift sil @_TF4test3fooFT1fGSqFT_T___T_ : $@convention(thin) (@owned Optional<@callee_owned (@in ()) -> @out ()>) -> () { bb0(%0 : $Optional<@callee_owned (@in ()) -> @out ()>): %1 = alloc_box $Optional<@callee_owned (@in ()) -> @out ()> // var f // users: %2, %6, %32 - %1a = project_box %1 : $@box Optional<@callee_owned (@in ()) -> @out ()> + %1a = project_box %1 : $@box Optional<@callee_owned (@in ()) -> @out ()>, 0 store %0 to %1a : $*Optional<@callee_owned (@in ()) -> @out ()> // id: %2 %3 = alloc_stack $Optional<()> // users: %22, %28, %30, %31 %4 = alloc_stack $() // users: %12, %22, %25 diff --git a/test/SIL/Parser/basic.sil b/test/SIL/Parser/basic.sil index 7096718e219..5a92ab3151a 100644 --- a/test/SIL/Parser/basic.sil +++ b/test/SIL/Parser/basic.sil @@ -66,7 +66,7 @@ bb1: bb2: %5 = tuple () // CHECK: %5 = tuple () %6 = alloc_box $Int // CHECK: %6 = alloc_box $Int - %7 = project_box %6 : $@box Int // CHECK: %7 = project_box %6 : $@box Int + %7 = project_box %6 : $@box Int, 0 // CHECK: %7 = project_box %6 : $@box Int br bb1 // CHECK: br bb1 } @@ -284,7 +284,7 @@ sil @_T4todo18erasure_from_protoFT1xPS_8RuncibleS_8Bendable__PS0__ : $@conventio bb0(%0 : $*Runcible, %1 : $*Bendable & Runcible): // CHECK: alloc_box %2 = alloc_box $Bendable & Runcible - %2a = project_box %2 : $@box Bendable & Runcible + %2a = project_box %2 : $@box Bendable & Runcible, 0 // CHECK: copy_addr [take] {{.*}} to [initialization] {{.*}} : $*Bendable & Runcible %3 = copy_addr [take] %1 to [initialization] %2a : $*Bendable & Runcible // CHECK: alloc_stack @@ -310,7 +310,7 @@ protocol ClassBound : class { sil @_T4todo18class_bound_methodFT1xPS_10ClassBound__T_ : $@convention(thin) (ClassBound) -> () { bb0(%0 : $ClassBound): %1 = alloc_box $ClassBound // CHECK: alloc_box - %1a = project_box %1 : $@box ClassBound + %1a = project_box %1 : $@box ClassBound, 0 %2 = store %0 to %1a : $*ClassBound // CHECK: store %3 = load %1a : $*ClassBound // CHECK: load %4 = strong_retain %3 : $ClassBound // CHECK: strong_retain @@ -356,7 +356,7 @@ sil @_TV6struct5AlephCfMS0_FT_S0_ : $@convention(thin) (@thin Aleph.Type) -> Ale bb0(%0 : $@thin Aleph.Type): %1 = tuple () %2 = alloc_box $Aleph // CHECK: alloc_box - %2a = project_box %2 : $@box Aleph + %2a = project_box %2 : $@box Aleph, 0 // CHECK: struct_element_addr {{.*}} : $*Aleph, #Aleph.a %5 = struct_element_addr %2a : $*Aleph, #Aleph.a %6 = load %5 : $*Ref @@ -422,7 +422,7 @@ sil @_T5tuple5tupleFT_TSiSf_ : $@convention(thin) () -> (Int, Float32) sil @_T5tuple13tuple_elementFT1xTSiSf__T_ : $@convention(thin) (Int, Float) -> () { bb0(%0 : $Int, %1 : $Float): %2 = alloc_box $(Int, Float) - %2a = project_box %2 : $@box (Int, Float) + %2a = project_box %2 : $@box (Int, Float), 0 // CHECK: tuple ({{%.*}} : $Int, {{%.*}} : $Float) %3 = tuple (%0 : $Int, %1 : $Float) %4 = store %3 to %2a : $*(Int, Float) @@ -458,10 +458,10 @@ class M { sil @_TC3ref1C3foofS0_FT1xSi_T_ : $@convention(method) (Int, M) -> () { bb0(%0 : $Int, %1 : $M): %2 = alloc_box $Int // CHECK: alloc_box $Int - %2a = project_box %2 : $@box Int + %2a = project_box %2 : $@box Int, 0 %3 = store %0 to %2a : $*Int %4 = alloc_box $M // CHECK: alloc_box $M - %4a = project_box %4 : $@box M + %4a = project_box %4 : $@box M, 0 %5 = store %1 to %4a : $*M %6 = load %2a : $*Int // CHECK: load {{.*}} : $*Int %7 = load %4a : $*M // CHECK: load {{.*}} : $*M @@ -498,7 +498,7 @@ class E : B { } sil @_T4null3isaFT1bCS_1B_Sb : $@convention(thin) (B) -> Builtin.Int1 { bb0(%0 : $B): %1 = alloc_box $B // CHECK: alloc_box - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = load %1a : $*B // CHECK: load %4 = strong_retain %3 : $B @@ -522,9 +522,9 @@ sil @_TSS32_convertFromBuiltinStringLiteralfMSSFT5valueBp17utf8CodeUnitCountBi64 sil @_T5index5gep64FT1pBp1iBi64__Bp : $@convention(thin) (Builtin.RawPointer, Builtin.Word) -> Builtin.RawPointer { bb0(%0 : $Builtin.RawPointer, %1 : $Builtin.Word): %2 = alloc_box $Builtin.RawPointer // CHECK: alloc_box - %2a = project_box %2 : $@box Builtin.RawPointer + %2a = project_box %2 : $@box Builtin.RawPointer, 0 %3 = alloc_box $Builtin.Word // CHECK: alloc_box - %3a = project_box %3 : $@box Builtin.Word + %3a = project_box %3 : $@box Builtin.Word, 0 %4 = store %0 to %2a : $*Builtin.RawPointer %5 = store %1 to %3a : $*Builtin.Word %7 = load %2a : $*Builtin.RawPointer // CHECK: load @@ -564,9 +564,9 @@ class SomeSubclass : SomeClass {} sil @test_class_metatype : $@convention(thin) (SomeClass, SomeSubclass) -> (@thick SomeClass.Type, @thick SomeClass.Type) { bb0(%0 : $SomeClass, %1 : $SomeSubclass): %2 = alloc_box $SomeClass // CHECK: alloc_box - %2a = project_box %2 : $@box SomeClass + %2a = project_box %2 : $@box SomeClass, 0 %3 = alloc_box $SomeSubclass // CHECK: alloc_box - %3a = project_box %3 : $@box SomeSubclass + %3a = project_box %3 : $@box SomeSubclass, 0 %4 = store %0 to %2a : $*SomeClass %5 = store %1 to %3a : $*SomeSubclass %7 = load %2a : $*SomeClass // CHECK: load @@ -589,7 +589,7 @@ bb0(%0 : $SomeClass, %1 : $SomeSubclass): sil @test_value_metatype : $@convention(thin) (@in T) -> (@thick T.Type, @thick T.Type) { bb0(%0 : $*T): %1 = alloc_box $T // CHECK: alloc_box - %1a = project_box %1 : $@box T + %1a = project_box %1 : $@box T, 0 %2 = copy_addr [take] %0 to [initialization] %1a : $*T %3 = metatype $@thick T.Type // CHECK: metatype %5 = alloc_stack $T // CHECK: alloc_stack @@ -606,7 +606,7 @@ bb0(%0 : $*T): sil @test_existential_metatype : $@convention(thin) (@in SomeProtocol) -> @thick SomeProtocol.Type { bb0(%0 : $*SomeProtocol): %1 = alloc_box $SomeProtocol // CHECK: alloc_box - %1a = project_box %1 : $@box SomeProtocol + %1a = project_box %1 : $@box SomeProtocol, 0 %2 = copy_addr [take] %0 to [initialization] %1a : $*SomeProtocol %4 = alloc_stack $SomeProtocol // CHECK: alloc_stack %5 = copy_addr %1a to [initialization] %4 : $*SomeProtocol @@ -673,9 +673,9 @@ bb3(%4 : $Int): sil @test_builtin : $@convention(thin) (Builtin.Int1, Builtin.Int1) -> Builtin.Int1 { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int1): %2 = alloc_box $Builtin.Int1 - %2a = project_box %2 : $@box Builtin.Int1 + %2a = project_box %2 : $@box Builtin.Int1, 0 %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 store %0 to %2a : $*Builtin.Int1 store %1 to %3a : $*Builtin.Int1 %8 = load %2a : $*Builtin.Int1 @@ -766,7 +766,7 @@ sil @closure0 : $@convention(thin) (@box Int, @inout Int) -> () sil @closure_test : $@convention(thin) () -> () { bb0: %0 = alloc_box $Int // users: %10, %8, %8, %7, %4 - %0a = project_box %0 : $@box Int + %0a = project_box %0 : $@box Int, 0 %5 = function_ref @takes_closure : $@convention(thin) (@callee_owned () -> ()) -> () %6 = function_ref @closure0 : $@convention(thin) (@box Int, @inout Int) -> () @@ -807,7 +807,7 @@ sil @_T6switch1cFT_T_ : $@convention(thin) () -> () sil @test_switch_union : $@convention(thin) (MaybePair) -> () { bb0(%0 : $MaybePair): %1 = alloc_box $MaybePair - %1a = project_box %1 : $@box MaybePair + %1a = project_box %1 : $@box MaybePair, 0 store %0 to %1a : $*MaybePair %3 = load %1a : $*MaybePair %4 = tuple () @@ -969,7 +969,7 @@ struct Spoon : Bendable { sil @test_init_existential : $@convention(thin) (Spoon) -> @out Bendable { bb0(%0 : $*Bendable, %1 : $Spoon): %2 = alloc_box $Spoon - %2a = project_box %2 : $@box Spoon + %2a = project_box %2 : $@box Spoon, 0 store %1 to %2a : $*Spoon // CHECK: init_existential_addr %{{.*}} : $*Bendable, $Spoon %4 = init_existential_addr %0 : $*Bendable, $Spoon @@ -986,7 +986,7 @@ bb0(%0 : $*Bendable, %1 : $Spoon): sil @test_existential_ref : $@convention(thin) (ConcreteClass) -> ClassP { bb0(%0 : $ConcreteClass): %1 = alloc_box $ConcreteClass - %1a = project_box %1 : $@box ConcreteClass + %1a = project_box %1 : $@box ConcreteClass, 0 store %0 to %1a : $*ConcreteClass %3 = load %1a : $*ConcreteClass strong_retain %3 : $ConcreteClass @@ -1041,7 +1041,7 @@ class X { sil @test_dynamic_lookup_br : $@convention(thin) (AnyObject) -> () { bb0(%0 : $AnyObject): %1 = alloc_box $AnyObject - %1a = project_box %1 : $@box AnyObject + %1a = project_box %1 : $@box AnyObject, 0 store %0 to %1a : $*AnyObject %3 = alloc_box $Optional<() -> ()> %4 = load %1a : $*AnyObject @@ -1063,9 +1063,9 @@ bb3: // CHECK-LABEL: sil @test_mark_fn_escape sil @test_mark_fn_escape : $() -> () { %b = alloc_box $Int - %ba = project_box %b : $@box Int + %ba = project_box %b : $@box Int, 0 %c = alloc_box $Int - %ca = project_box %c : $@box Int + %ca = project_box %c : $@box Int, 0 // CHECK: mark_function_escape {{.*}} : $*Int mark_function_escape %ba : $*Int @@ -1458,8 +1458,8 @@ sil @box_type : $@convention(thin) (@box Int, Int) -> () { bb0(%0 : $@box Int, %1 : $Int): // CHECK-NEXT: strong_retain %0 : $@box Int strong_retain %0 : $@box Int - // CHECK-NEXT: %3 = project_box %0 : $@box Int - %3 = project_box %0 : $@box Int + // CHECK-NEXT: %3 = project_box %0 : $@box Int, 0 + %3 = project_box %0 : $@box Int, 0 // CHECK-NEXT: store %1 to %3 : $*Int store %1 to %3 : $*Int // CHECK-NEXT: strong_release %0 : $@box Int diff --git a/test/SIL/Parser/bound_generic.sil b/test/SIL/Parser/bound_generic.sil index 489f9a9f9a4..6004cd7d52f 100644 --- a/test/SIL/Parser/bound_generic.sil +++ b/test/SIL/Parser/bound_generic.sil @@ -10,7 +10,7 @@ import Swift sil @_TF9optional3fooFT1fGSqFT_T___T_ : $@convention(thin) (@owned Optional<@callee_owned (@in ()) -> (@out ())>) -> () { bb0(%0 : $Optional<@callee_owned (@in ()) -> (@out ())>): %1 = alloc_box $Optional<@callee_owned (@in ()) -> (@out ())> - %1a = project_box %1 : $@box Optional<@callee_owned (@in ()) -> (@out ())> + %1a = project_box %1 : $@box Optional<@callee_owned (@in ()) -> (@out ())>, 0 store %0 to %1a : $*Optional<@callee_owned (@in ()) -> (@out ())> %3 = alloc_stack $Optional<()> %4 = alloc_stack $() diff --git a/test/SIL/Parser/global_init_attribute.sil b/test/SIL/Parser/global_init_attribute.sil index 3f7bdb27bd4..2a3bedd6e27 100644 --- a/test/SIL/Parser/global_init_attribute.sil +++ b/test/SIL/Parser/global_init_attribute.sil @@ -15,7 +15,7 @@ import Swift sil [global_init] @_TF1gau5MyVarSi : $@convention(thin) () -> Builtin.RawPointer { bb0: %b = alloc_box $Int - %ba = project_box %b : $@box Int + %ba = project_box %b : $@box Int, 0 %p = address_to_pointer %ba : $*Int to $Builtin.RawPointer return %p : $Builtin.RawPointer } diff --git a/test/SIL/Parser/indirect_enum.sil b/test/SIL/Parser/indirect_enum.sil index 572fe3f3f21..93be86f373f 100644 --- a/test/SIL/Parser/indirect_enum.sil +++ b/test/SIL/Parser/indirect_enum.sil @@ -24,10 +24,10 @@ enum TreeInt { sil @indirect_enum : $@convention(thin) (@owned TreeA) -> () { entry(%e : $TreeA): %a = unchecked_enum_data %e : $TreeA, #TreeA.Leaf!enumelt.1 - %b = project_box %a : $@box T + %b = project_box %a : $@box T, 0 %c = unchecked_enum_data %e : $TreeA, #TreeA.Branch!enumelt.1 - %d = project_box %c : $@box (left: TreeA, right: TreeA) + %d = project_box %c : $@box (left: TreeA, right: TreeA), 0 return undef : $() } @@ -49,7 +49,7 @@ entry(%e : $TreeInt): store %a to undef : $*Int %c = unchecked_enum_data %e : $TreeInt, #TreeInt.Branch!enumelt.1 - %d = project_box %c : $@box (left: TreeInt, right: TreeInt) + %d = project_box %c : $@box (left: TreeInt, right: TreeInt), 0 return undef : $() } diff --git a/test/SIL/Parser/overloaded_member.sil b/test/SIL/Parser/overloaded_member.sil index de9e8007662..b1977cfb632 100644 --- a/test/SIL/Parser/overloaded_member.sil +++ b/test/SIL/Parser/overloaded_member.sil @@ -19,9 +19,9 @@ struct A { sil @_TFCSo1XcfMS_FT1aV11peer_method1A_S_ : $@convention(method) (A, @owned X) -> @owned X { bb0(%0 : $A, %1 : $X): %2 = alloc_box $X - %2a = project_box %2 : $@box X + %2a = project_box %2 : $@box X, 0 %3 = alloc_box $A - %3a = project_box %3 : $@box A + %3a = project_box %3 : $@box A, 0 store %0 to %3a : $*A %5 = mark_uninitialized [delegatingself] %1 : $X store %5 to %2a : $*X diff --git a/test/SIL/Parser/typed_boxes.sil b/test/SIL/Parser/typed_boxes.sil index 18d950584f9..fede1984737 100644 --- a/test/SIL/Parser/typed_boxes.sil +++ b/test/SIL/Parser/typed_boxes.sil @@ -7,8 +7,8 @@ sil @alloc_dealloc : $@convention(thin) (Int) -> () { entry(%x : $Int): // CHECK: [[B:%.*]] = alloc_box $Int %b = alloc_box $Int - // CHECK: [[PB:%.*]] = project_box [[B]] : $@box Int - %ba = project_box %b : $@box Int + // CHECK: [[PB:%.*]] = project_box [[B]] : $@box Int, 0 + %ba = project_box %b : $@box Int, 0 // CHECK: store [[X:%.*]] to [[PB]] : $*Int store %x to %ba : $*Int // CHECK: dealloc_box [[B]] : $@box Int diff --git a/test/SILOptimizer/allocbox_to_stack.sil b/test/SILOptimizer/allocbox_to_stack.sil index d138cd067c8..bf502bcb618 100644 --- a/test/SILOptimizer/allocbox_to_stack.sil +++ b/test/SILOptimizer/allocbox_to_stack.sil @@ -14,7 +14,7 @@ struct Bool { sil @simple_promotion : $(Int) -> Int { bb0(%0 : $Int): %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %2 = store %0 to %1a : $*Int %3 = load %1a : $*Int %4 = strong_release %1 : $@box Int @@ -30,10 +30,10 @@ bb0(%0 : $Int): sil @double_project_box : $(Int) -> (Int, Int) { bb0(%0 : $Int): %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %2 = store %0 to %1a : $*Int %3 = load %1a : $*Int - %1b = project_box %1 : $@box Int + %1b = project_box %1 : $@box Int, 0 %3b = load %1b : $*Int %4 = strong_release %1 : $@box Int %r = tuple (%3 : $Int, %3b : $Int) @@ -49,7 +49,7 @@ bb0(%0 : $Int): sil @init_var : $() -> Int { bb0: %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %3 = load %1a : $*Int %4 = strong_release %1 : $@box Int %5 = return %3 : $Int @@ -66,7 +66,7 @@ bb0: sil @multi_strong_release : $() -> Int { bb0: %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %2 = mark_uninitialized [rootself] %1a : $*Int %3 = load %2 : $*Int %x = strong_retain %1 : $@box Int @@ -93,9 +93,9 @@ bb1(%0 : $Int): // CHECK-DAG: [[STRUCT:%.*]] = alloc_stack $TestStruct // CHECK-DAG: [[TUPLE:%.*]] = alloc_stack $(Int, Int) %1 = alloc_box $TestStruct - %1a = project_box %1 : $@box TestStruct + %1a = project_box %1 : $@box TestStruct, 0 %a = alloc_box $(Int, Int) - %aa = project_box %a : $@box (Int, Int) + %aa = project_box %a : $@box (Int, Int), 0 %2 = struct_element_addr %1a : $*TestStruct, #TestStruct.Elt %3 = store %0 to %2 : $*Int @@ -126,7 +126,7 @@ sil @inout_nocapture : $@convention(thin) () -> Int { bb0: // CHECK: alloc_stack %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %6 = function_ref @callee : $@convention(thin) (@inout Int) -> () %7 = apply %6(%1a) : $@convention(thin) (@inout Int) -> () %8 = load %1a : $*Int @@ -150,7 +150,7 @@ bb0: // CHECK: alloc_stack %1 = function_ref @returns_protocol : $@convention(thin) () -> @out P %2 = alloc_box $P - %2a = project_box %2 : $@box P + %2a = project_box %2 : $@box P, 0 %3 = apply %1(%2a) : $@convention(thin) () -> @out P %5 = strong_release %2 : $@box P %0 = tuple () @@ -164,7 +164,7 @@ class SomeClass {} sil @class_promotion : $(SomeClass) -> SomeClass { bb0(%0 : $SomeClass): %1 = alloc_box $SomeClass - %1a = project_box %1 : $@box SomeClass + %1a = project_box %1 : $@box SomeClass, 0 %2 = store %0 to %1a : $*SomeClass %3 = load %1a : $*SomeClass %4 = strong_release %1 : $@box SomeClass @@ -185,7 +185,7 @@ protocol LogicValue { sil @protocols : $@convention(thin) (@in LogicValue, @thin Bool.Type) -> Bool { bb0(%0 : $*LogicValue, %1 : $@thin Bool.Type): %2 = alloc_box $LogicValue - %2a = project_box %2 : $@box LogicValue + %2a = project_box %2 : $@box LogicValue, 0 // CHECK: %2 = alloc_stack $LogicValue copy_addr [take] %0 to [initialization] %2a : $*LogicValue %6 = open_existential_addr %2a : $*LogicValue to $*@opened("01234567-89ab-cdef-0123-000000000000") LogicValue @@ -230,7 +230,7 @@ sil @union_test : $@convention(thin) () -> () { bb0: // CHECK: [[UNION:%.*]] = alloc_stack %1 = alloc_box $SomeUnion - %1a = project_box %1 : $@box SomeUnion + %1a = project_box %1 : $@box SomeUnion, 0 %2 = function_ref @_TO1t9SomeUnion1yfMS0_FCS_9SomeClassS0_ : $@convention(thin) (@owned SomeClass, @thin SomeUnion.Type) -> @owned SomeUnion // user: %7 %3 = metatype $@thin SomeUnion.Type %4 = function_ref @_TC1t9SomeClassCfMS0_FT_S0_ : $@convention(thin) (@thick SomeClass.Type) -> @owned SomeClass // user: %6 @@ -250,7 +250,7 @@ bb0: sil @multiple_release_test : $@convention(thin) (Bool) -> Bool { bb0(%0 : $Bool): %1 = alloc_box $Bool - %1a = project_box %1 : $@box Bool + %1a = project_box %1 : $@box Bool, 0 store %0 to %1a : $*Bool strong_retain %1 : $@box Bool strong_retain %1 : $@box Bool @@ -313,7 +313,7 @@ extension Int : My_Incrementable { } sil @test_mui : $@convention(thin) (Builtin.Int1) -> () { bb0(%0 : $Builtin.Int1): %2 = alloc_box $SomeClass - %2a = project_box %2 : $@box SomeClass + %2a = project_box %2 : $@box SomeClass, 0 // CHECK: [[STACK:%[0-9]+]] = alloc_stack %3 = mark_uninitialized [var] %2a : $*SomeClass // CHECK: [[MUI:%[0-9]+]] = mark_uninitialized @@ -373,7 +373,7 @@ bb0(%0 : $Int): debug_value %0 : $Int, let, name "t" // id: %1 // CHECK: alloc_stack %2 = alloc_box $Int, var, name "s" // users: %3, %6, %7, %7, %9 - %2a = project_box %2 : $@box Int + %2a = project_box %2 : $@box Int, 0 store %0 to %2a : $*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 @@ -394,7 +394,7 @@ bb0(%0 : $Int): // struct.(useStack (t : Swift.Int) -> ()).(closure #1) sil private @_TFF6struct8useStackFT1tSi_T_U_FT_Si : $@convention(thin) (@owned @box Int) -> Int { bb0(%0 : $@box Int): - %1 = project_box %0 : $@box Int + %1 = project_box %0 : $@box Int, 0 // function_ref Swift.++ @postfix (x : @inout A) -> A %2 = function_ref @_TFsoP2ppUs14_Incrementable__FT1xRQ__Q_ : $@convention(thin) <τ_0_0 where τ_0_0 : My_Incrementable> (@inout τ_0_0) -> @out τ_0_0 // user: %4 %3 = alloc_stack $Int // users: %4, %5, %6 @@ -415,7 +415,7 @@ bb0(%0 : $Int): debug_value %0 : $Int, let, name "t" // id: %1 // CHECK: alloc_box %2 = alloc_box $Int, var, name "s" // users: %3, %6, %7, %7, %10 - %2a = project_box %2 : $@box Int + %2a = project_box %2 : $@box Int, 0 store %0 to %2a : $*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 @@ -434,7 +434,7 @@ bb0(%0 : $Int): // struct.(useBox (t : Swift.Int) -> ()).(closure #1) sil private @_TFF6struct6useBoxFT1tSi_T_U_FT_Si : $@convention(thin) (@owned @box Int) -> Int { bb0(%0 : $@box Int): - %1 = project_box %0 : $@box Int + %1 = project_box %0 : $@box Int, 0 // function_ref Swift.++ @postfix (x : @inout A) -> A %2 = function_ref @_TFsoP2ppUs14_Incrementable__FT1xRQ__Q_ : $@convention(thin) <τ_0_0 where τ_0_0 : My_Incrementable> (@inout τ_0_0) -> @out τ_0_0 // user: %4 %3 = alloc_stack $Int // users: %4, %5, %6 @@ -452,7 +452,7 @@ sil @closure : $@convention(thin) (@owned @box Int) -> () sil @no_final_release : $@convention(thin) (Int) -> Bool { bb0(%0 : $Int): %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 store %0 to %1a : $*Int // function_ref main.(newFoo (Swift.Int) -> Swift.Bool).(modify #1) (())() %3 = function_ref @closure : $@convention(thin) (@owned @box Int) -> () @@ -492,7 +492,7 @@ bb0(%0 : $*T): %3 = function_ref @closure_to_specialize : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned @box τ_0_0) -> @out τ_0_0 // CHECK-NOT: alloc_box %4 = alloc_box $T - %4a = project_box %4 : $@box T + %4a = project_box %4 : $@box T, 0 // CHECK: copy_addr %0 to [initialization] [[STACK]] : $*T copy_addr %0 to [initialization] %4a : $*T // CHECK: [[CLOSURE:%[0-9a-zA-Z]+]] = function_ref @_TTSf0n_k__closure_to_specialize @@ -511,7 +511,7 @@ bb0(%0 : $*T): sil shared @closure_to_specialize : $@convention(thin) (@owned @box T) -> @out T { // CHECK: bb0 bb0(%0 : $*T, %1 : $@box T): - %2 = project_box %1 : $@box T + %2 = project_box %1 : $@box T, 0 // CHECK-NEXT: copy_addr copy_addr %2 to [initialization] %0 : $*T // CHECK-NOT: strong_release @@ -573,7 +573,7 @@ bb0(%0 : $Int, %1 : $*S): %4 = function_ref @outer : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool %5 = function_ref @closure1 : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %6 = alloc_box $S - %6a = project_box %6 : $@box S + %6a = project_box %6 : $@box S, 0 copy_addr %1 to [initialization] %6a : $*S %8 = partial_apply %5(%0, %6) : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %9 = apply %4(%8) : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool @@ -591,7 +591,7 @@ bb0(%0 : $Int, %1 : $*S): %4 = function_ref @outer : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool %5 = function_ref @closure1 : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %6 = alloc_box $S - %6a = project_box %6 : $@box S + %6a = project_box %6 : $@box S, 0 copy_addr %1 to [initialization] %6a : $*S %8 = partial_apply %5(%0, %6) : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %9 = apply %4(%8) : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool @@ -604,11 +604,11 @@ bb0(%0 : $Int, %1 : $*S): sil shared @closure1 : $@convention(thin) (Int, @owned @box S) -> Bool { // CHECK: bb0 bb0(%0 : $Int, %1 : $@box S): - %2 = project_box %1 : $@box S + %2 = project_box %1 : $@box S, 0 %3 = function_ref @inner : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool %4 = function_ref @closure2 : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %5 = alloc_box $S - %5a = project_box %5 : $@box S + %5a = project_box %5 : $@box S, 0 copy_addr %2 to [initialization] %5a : $*S %7 = partial_apply %4(%0, %5) : $@convention(thin) <τ_0_0 where τ_0_0 : Count> (Int, @owned @box S<τ_0_0>) -> Bool %8 = apply %3(%7) : $@convention(thin) (@owned @callee_owned () -> Bool) -> Bool @@ -626,7 +626,7 @@ bb0(%0 : $Int, %1 : $@box S): sil shared @closure2 : $@convention(thin) (Int, @owned @box S) -> Bool { // CHECK: bb0 bb0(%0 : $Int, %1 : $@box S): - %2 = project_box %1 : $@box S + %2 = project_box %1 : $@box S, 0 %3 = function_ref @binary : $@convention(thin) (Int, Int) -> Bool %4 = alloc_stack $S copy_addr %2 to [initialization] %4 : $*S @@ -651,7 +651,7 @@ bb0(%0 : $*T, %1 : $*T): // CHECK: [[APPLIED:%.*]] = function_ref %3 = function_ref @applied : $@convention(thin) <τ_0_0> (@owned @box τ_0_0) -> () %4 = alloc_box $T - %4a = project_box %4 : $@box T + %4a = project_box %4 : $@box T, 0 copy_addr %1 to [initialization] %4a : $*T // CHECK: [[PARTIAL:%.*]] = partial_apply [[APPLIED]]([[STACK]]) %6 = partial_apply %3(%4) : $@convention(thin) <τ_0_0> (@owned @box τ_0_0) -> () @@ -673,7 +673,7 @@ bb0(%0 : $*T, %1 : $*T): sil @applied : $@convention(thin) (@owned @box T) -> () { bb0(%0 : $@box T): - %1 = project_box %0 : $@box T + %1 = project_box %0 : $@box T, 0 %2 = function_ref @consume : $@convention(thin) <τ_0_0> (@in τ_0_0) -> () %3 = alloc_stack $T copy_addr %1 to [initialization] %3 : $*T diff --git a/test/SILOptimizer/arcsequenceopts.sil b/test/SILOptimizer/arcsequenceopts.sil index c2e5b2a2e1a..3aa77c02bb2 100644 --- a/test/SILOptimizer/arcsequenceopts.sil +++ b/test/SILOptimizer/arcsequenceopts.sil @@ -328,7 +328,7 @@ bb1: // SHOULD-NOT: strong_release sil @simple_alias_store_use_test : $@convention(thin) (@box Builtin.Int32) -> () { bb0(%0 : $@box Builtin.Int32): - %1 = project_box %0 : $@box Builtin.Int32 + %1 = project_box %0 : $@box Builtin.Int32, 0 %2 = function_ref @user : $@convention(thin) (@box Builtin.Int32) -> () %3 = integer_literal $Builtin.Int32, 2 strong_retain %0 : $@box Builtin.Int32 @@ -356,7 +356,7 @@ bb0(%0 : $@box Builtin.Int32): sil @simple_alias_load_use_test : $@convention(thin) (@inout Builtin.Int32) -> () { bb0(%0 : $*Builtin.Int32): %1 = alloc_box $Builtin.Int32 - %1a = project_box %1 : $@box Builtin.Int32 + %1a = project_box %1 : $@box Builtin.Int32, 0 %2 = function_ref @user : $@convention(thin) (@box Builtin.Int32) -> () strong_retain %1 : $@box Builtin.Int32 apply %2 (%1) : $@convention(thin) (@box Builtin.Int32) -> () @@ -383,7 +383,7 @@ bb0(%0 : $*Builtin.Int32): sil @simple_alias_load_use_test_two_release : $@convention(thin) (@inout Builtin.Int32) -> () { bb0(%0 : $*Builtin.Int32): %1 = alloc_box $Builtin.Int32 - %1a = project_box %1 : $@box Builtin.Int32 + %1a = project_box %1 : $@box Builtin.Int32, 0 %2 = function_ref @user : $@convention(thin) (@box Builtin.Int32) -> () strong_retain %1 : $@box Builtin.Int32 strong_retain %1 : $@box Builtin.Int32 diff --git a/test/SILOptimizer/capture_promotion.sil b/test/SILOptimizer/capture_promotion.sil index 08576a8f113..8040ffeeb04 100644 --- a/test/SILOptimizer/capture_promotion.sil +++ b/test/SILOptimizer/capture_promotion.sil @@ -32,19 +32,19 @@ sil @test_capture_promotion : $@convention(thin) () -> @owned @callee_owned () - bb0: %0 = tuple () %1 = alloc_box $Foo - %1a = project_box %1 : $@box Foo + %1a = project_box %1 : $@box Foo, 0 %2 = function_ref @foo_allocating_init : $@convention(thin) (@thick Foo.Type) -> @owned Foo %3 = metatype $@thick Foo.Type %4 = apply %2(%3) : $@convention(thin) (@thick Foo.Type) -> @owned Foo store %4 to %1a : $*Foo %6 = alloc_box $Baz - %6a = project_box %6 : $@box Baz + %6a = project_box %6 : $@box Baz, 0 %7 = function_ref @baz_init : $@convention(thin) (@thin Baz.Type) -> @owned Baz %8 = metatype $@thin Baz.Type %9 = apply %7(%8) : $@convention(thin) (@thin Baz.Type) -> @owned Baz store %9 to %6a : $*Baz %11 = alloc_box $Int - %11a = project_box %11 : $@box Int + %11a = project_box %11 : $@box Int, 0 %12 = function_ref @convert_from_integer_literal : $@convention(thin) (Builtin.Word, @thin Int.Type) -> Int %13 = metatype $@thin Int.Type %14 = integer_literal $Builtin.Word, 3 @@ -91,19 +91,19 @@ sil @test_capture_promotion_indirect : $@convention(thin) () -> @owned @callee_o bb0: %0 = tuple () %1 = alloc_box $Foo - %1a = project_box %1 : $@box Foo + %1a = project_box %1 : $@box Foo, 0 %2 = function_ref @foo_allocating_init : $@convention(thin) (@thick Foo.Type) -> @owned Foo %3 = metatype $@thick Foo.Type %4 = apply %2(%3) : $@convention(thin) (@thick Foo.Type) -> @owned Foo store %4 to %1a : $*Foo %6 = alloc_box $Baz - %6a = project_box %6 : $@box Baz + %6a = project_box %6 : $@box Baz, 0 %7 = function_ref @baz_init : $@convention(thin) (@thin Baz.Type) -> @owned Baz %8 = metatype $@thin Baz.Type %9 = apply %7(%8) : $@convention(thin) (@thin Baz.Type) -> @owned Baz store %9 to %6a : $*Baz %11 = alloc_box $Int - %11a = project_box %11 : $@box Int + %11a = project_box %11 : $@box Int, 0 %12 = function_ref @convert_from_integer_literal : $@convention(thin) (Builtin.Word, @thin Int.Type) -> Int %13 = metatype $@thin Int.Type %14 = integer_literal $Builtin.Word, 3 @@ -173,9 +173,9 @@ bb0: sil private @closure0 : $@convention(thin) (@owned @box Foo, @owned @box Baz, @owned @box Int) -> Int { bb0(%0 : $@box Foo, %2 : $@box Baz, %4 : $@box Int): - %1 = project_box %0 : $@box Foo - %3 = project_box %2 : $@box Baz - %5 = project_box %4 : $@box Int + %1 = project_box %0 : $@box Foo, 0 + %3 = project_box %2 : $@box Baz, 0 + %5 = project_box %4 : $@box Int, 0 %6 = tuple () // function_ref test14.plus (a : Swift.Int, b : Swift.Int, c : Swift.Int) -> Swift.Int %7 = function_ref @dummy_func : $@convention(thin) (Int, Int, Int) -> Int @@ -200,7 +200,7 @@ sil @test_unpromotable : $@convention(thin) () -> @owned @callee_owned () -> Int bb0: %0 = tuple () %1 = alloc_box $Foo - %1a = project_box %1 : $@box Foo + %1a = project_box %1 : $@box Foo, 0 %2 = function_ref @foo_allocating_init : $@convention(thin) (@thick Foo.Type) -> @owned Foo %3 = metatype $@thick Foo.Type %4 = apply %2(%3) : $@convention(thin) (@thick Foo.Type) -> @owned Foo @@ -217,7 +217,7 @@ sil @mutate_foo : $@convention(thin) (@inout Foo) -> () sil private @closure1 : $@convention(thin) (@box Foo) -> Int { bb0(%0 : $@box Foo): - %1 = project_box %0 : $@box Foo + %1 = project_box %0 : $@box Foo, 0 %6 = tuple () // function_ref test14.plus (a : Swift.Int, b : Swift.Int, c : Swift.Int) -> Swift.Int %7 = function_ref @dummy_func : $@convention(thin) (Int, Int, Int) -> Int @@ -238,10 +238,10 @@ sil @captureWithinGeneric : $@convention(thin) (@inout Int, @inout Int) -> ( // CHECK: bb0 bb0(%0 : $*Int, %1 : $*Int): %2 = alloc_box $Int - %2a = project_box %2 : $@box Int + %2a = project_box %2 : $@box Int, 0 copy_addr %0 to [initialization] %2a : $*Int %4 = alloc_box $Int - %4a = project_box %4 : $@box Int + %4a = project_box %4 : $@box Int, 0 copy_addr %1 to [initialization] %4a : $*Int %6 = function_ref @apply : $@convention(thin) (@owned @callee_owned () -> ()) -> () // CHECK: [[PROMOTED:%[0-9a-zA-Z]+]] = function_ref @_TTSf2n_i__closureWithGenericSignature : $@convention(thin) <τ_0_0> (@owned @box Int, Int) -> () @@ -262,8 +262,8 @@ bb0(%0 : $*Int, %1 : $*Int): // CHECK: sil @_TTSf2n_i__closureWithGenericSignature : $@convention(thin) <{{[^>]+}}> (@owned @box Int, Int) -> () sil @closureWithGenericSignature : $@convention(thin) (@owned @box Int, @owned @box Int) -> () { bb0(%0 : $@box Int, %2 : $@box Int): - %1 = project_box %0 : $@box Int - %3 = project_box %2 : $@box Int + %1 = project_box %0 : $@box Int, 0 + %3 = project_box %2 : $@box Int, 0 %4 = function_ref @_TFsoi1pFTSiSi_Si : $@convention(thin) (Int, Int) -> Int %5 = load %3 : $*Int %6 = load %3 : $*Int @@ -280,9 +280,9 @@ sil [transparent] [fragile] @_TFsoi1pFTSiSi_Si : $@convention(thin) (Int, Int) - sil private @closure_indirect_result : $@convention(thin) (@owned @box Foo, @owned @box Baz, @owned @box Int) -> @out Int { bb0(%0: $*Int, %1 : $@box Foo, %2 : $@box Baz, %4 : $@box Int): - %17 = project_box %1 : $@box Foo - %3 = project_box %2 : $@box Baz - %5 = project_box %4 : $@box Int + %17 = project_box %1 : $@box Foo, 0 + %3 = project_box %2 : $@box Baz, 0 + %5 = project_box %4 : $@box Int, 0 %6 = tuple () // function_ref test14.plus (a : Swift.Int, b : Swift.Int, c : Swift.Int) -> Swift.Int %7 = function_ref @dummy_func : $@convention(thin) (Int, Int, Int) -> Int diff --git a/test/SILOptimizer/capture_promotion_reachability.sil b/test/SILOptimizer/capture_promotion_reachability.sil index a5be1c68997..4250475a423 100644 --- a/test/SILOptimizer/capture_promotion_reachability.sil +++ b/test/SILOptimizer/capture_promotion_reachability.sil @@ -28,11 +28,11 @@ func test_reachability_1(b: Builtin.Int1, x: Builtin.Int64, y: Builtin.Int64) { sil @test_reachability_1 : $@convention(thin) (Builtin.Int1, Builtin.Int64, Builtin.Int64) -> () { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int64, %2 : $Builtin.Int64): %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 %4 = alloc_box $Builtin.Int64 - %4a = project_box %4 : $@box Builtin.Int64 + %4a = project_box %4 : $@box Builtin.Int64, 0 %5 = alloc_box $Builtin.Int64 - %5a = project_box %5 : $@box Builtin.Int64 + %5a = project_box %5 : $@box Builtin.Int64, 0 store %0 to %3a : $*Builtin.Int1 store %1 to %4a : $*Builtin.Int64 store %2 to %5a : $*Builtin.Int64 @@ -46,7 +46,7 @@ bb1: bb2: %14 = alloc_box $@callee_owned () -> Builtin.Int64 - %14a = project_box %14 : $@box @callee_owned () -> Builtin.Int64 + %14a = project_box %14 : $@box @callee_owned () -> Builtin.Int64, 0 // CHECK: [[CLOSURE0_PROMOTE0:%.*]] = function_ref @_TTSf2i__closure0 : %15 = function_ref @closure0 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 strong_retain %4 : $@box Builtin.Int64 @@ -77,7 +77,7 @@ bb4: // closure0 sil private @closure0 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -87,7 +87,7 @@ bb0(%0 : $@box Builtin.Int64): // closure1 sil private @closure1 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -110,16 +110,16 @@ func test_reachability_2(b: Builtin.Int1, x: Builtin.Int64, y: Builtin.Int64) { sil @test_reachability_2 : $@convention(thin) (Builtin.Int1, Builtin.Int64, Builtin.Int64) -> () { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int64, %2 : $Builtin.Int64): %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 %4 = alloc_box $Builtin.Int64 - %4a = project_box %4 : $@box Builtin.Int64 + %4a = project_box %4 : $@box Builtin.Int64, 0 %5 = alloc_box $Builtin.Int64 - %5a = project_box %5 : $@box Builtin.Int64 + %5a = project_box %5 : $@box Builtin.Int64, 0 store %0 to %3a : $*Builtin.Int1 store %1 to %4a : $*Builtin.Int64 store %2 to %5a : $*Builtin.Int64 %9 = alloc_box $@callee_owned () -> Builtin.Int64 - %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64 + %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64, 0 // CHECK: [[CLOSURE2:%.*]] = function_ref @closure2 : %10 = function_ref @closure2 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 strong_retain %4 : $@box Builtin.Int64 @@ -159,7 +159,7 @@ bb4: // closure2 sil private @closure2 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -169,7 +169,7 @@ bb0(%0 : $@box Builtin.Int64): // closure3 sil private @closure3 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -192,16 +192,16 @@ func test_reachability_3(b: Builtin.Int1, x: Builtin.Int64, y: Builtin.Int64) { sil @test_reachability_3 : $@convention(thin) (Builtin.Int1, Builtin.Int64, Builtin.Int64) -> () { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int64, %2 : $Builtin.Int64): %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 %4 = alloc_box $Builtin.Int64 - %4a = project_box %4 : $@box Builtin.Int64 + %4a = project_box %4 : $@box Builtin.Int64, 0 %5 = alloc_box $Builtin.Int64 - %5a = project_box %5 : $@box Builtin.Int64 + %5a = project_box %5 : $@box Builtin.Int64, 0 store %0 to %3a : $*Builtin.Int1 store %1 to %4a : $*Builtin.Int64 store %2 to %5a : $*Builtin.Int64 %9 = alloc_box $@callee_owned () -> Builtin.Int64 - %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64 + %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64, 0 // CHECK: [[CLOSURE4:%.*]] = function_ref @closure4 : %10 = function_ref @closure4 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 strong_retain %4 : $@box Builtin.Int64 @@ -241,7 +241,7 @@ bb4: // closure4 sil private @closure4 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -251,7 +251,7 @@ bb0(%0 : $@box Builtin.Int64): // closure5 sil private @closure5 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -272,16 +272,16 @@ func test_reachability_4(b: Builtin.Int1, x: Builtin.Int64, y: Builtin.Int64) { sil @test_reachability_4 : $@convention(thin) (Builtin.Int1, Builtin.Int64, Builtin.Int64) -> () { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int64, %2 : $Builtin.Int64): %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 %4 = alloc_box $Builtin.Int64 - %4a = project_box %4 : $@box Builtin.Int64 + %4a = project_box %4 : $@box Builtin.Int64, 0 %5 = alloc_box $Builtin.Int64 - %5a = project_box %5 : $@box Builtin.Int64 + %5a = project_box %5 : $@box Builtin.Int64, 0 store %0 to %3a : $*Builtin.Int1 store %1 to %4a : $*Builtin.Int64 store %2 to %5a : $*Builtin.Int64 %9 = alloc_box $@callee_owned () -> Builtin.Int64 - %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64 + %9a = project_box %9 : $@box @callee_owned () -> Builtin.Int64, 0 // CHECK: [[CLOSURE6:%.*]] = function_ref @closure6 : %10 = function_ref @closure6 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 strong_retain %4 : $@box Builtin.Int64 @@ -317,7 +317,7 @@ bb3: // closure6 sil private @closure6 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 @@ -327,7 +327,7 @@ bb0(%0 : $@box Builtin.Int64): // closure7 sil private @closure7 : $@convention(thin) (@owned @box Builtin.Int64) -> Builtin.Int64 { bb0(%0 : $@box Builtin.Int64): - %1 = project_box %0 : $@box Builtin.Int64 + %1 = project_box %0 : $@box Builtin.Int64, 0 %2 = tuple () %3 = load %1 : $*Builtin.Int64 strong_release %0 : $@box Builtin.Int64 diff --git a/test/SILOptimizer/closure_specialize.sil b/test/SILOptimizer/closure_specialize.sil index 73e842c1e71..6b9e9cbfd83 100644 --- a/test/SILOptimizer/closure_specialize.sil +++ b/test/SILOptimizer/closure_specialize.sil @@ -79,10 +79,10 @@ bb0(%0 : $Int): sil shared @_TFF7specgen6callerFSiT_U_FTSiSi_T_ : $@convention(thin) (Int, Int, Int) -> () { bb0(%0 : $Int, %1 : $Int, %2 : $Int): %5 = alloc_box $Int, var, name "p" // users: %6, %10, %14 - %5a = project_box %5 : $@box Int + %5a = project_box %5 : $@box Int, 0 store %0 to %5a : $*Int // id: %6 %7 = alloc_box $Int, var, name "q" // users: %8, %11, %13 - %7a = project_box %7 : $@box Int + %7a = project_box %7 : $@box Int, 0 store %1 to %7a : $*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 @@ -445,7 +445,7 @@ bb0(%0 : $*Builtin.Int32, %1 : $@callee_owned (Builtin.Int32) -> ()): sil @pass_a_closure: $@convention(thin) () -> Builtin.Int32 { bb0: %0 = alloc_box $Builtin.Int32, var, name "i" - %0a = project_box %0 : $@box Builtin.Int32 + %0a = project_box %0 : $@box Builtin.Int32, 0 %1 = integer_literal $Builtin.Int32, 0 store %1 to %0a : $*Builtin.Int32 %4 = function_ref @closure_with_box_argument : $@convention(thin) (Builtin.Int32, @owned @box Builtin.Int32) -> () @@ -468,7 +468,7 @@ bb0: // CHECK-LABEL: sil shared @closure_with_box_argument sil shared @closure_with_box_argument : $@convention(thin) (Builtin.Int32, @owned @box Builtin.Int32) -> () { bb0(%0 : $Builtin.Int32, %1 : $@box Builtin.Int32): - %3 = project_box %1 : $@box Builtin.Int32 + %3 = project_box %1 : $@box Builtin.Int32, 0 store %0 to %3 : $*Builtin.Int32 strong_release %1 : $@box Builtin.Int32 %7 = tuple () diff --git a/test/SILOptimizer/cse.sil b/test/SILOptimizer/cse.sil index 060de454258..a31eaaa5d1d 100644 --- a/test/SILOptimizer/cse.sil +++ b/test/SILOptimizer/cse.sil @@ -111,7 +111,7 @@ bb0: sil @removeTriviallyDeadInstructions : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = load %1a : $*B %4 = strong_retain %3 : $B @@ -424,8 +424,8 @@ bb0(%0 : $*Interval): // CHECK: return sil @project_box_test : $(@box Builtin.Int32) -> Builtin.Int32 { bb0(%0 : $@box Builtin.Int32): - %1 = project_box %0 : $@box Builtin.Int32 - %2 = project_box %0 : $@box Builtin.Int32 + %1 = project_box %0 : $@box Builtin.Int32, 0 + %2 = project_box %0 : $@box Builtin.Int32, 0 %3 = function_ref @sadd_with_address : $@convention(thin) (@inout Builtin.Int32, @inout Builtin.Int32) -> (Builtin.Int32) %4 = apply %3(%1, %2) : $@convention(thin) (@inout Builtin.Int32, @inout Builtin.Int32) -> (Builtin.Int32) return %4 : $(Builtin.Int32) diff --git a/test/SILOptimizer/dead_store_elim.sil b/test/SILOptimizer/dead_store_elim.sil index 2fcbc76b0aa..3125124d73d 100644 --- a/test/SILOptimizer/dead_store_elim.sil +++ b/test/SILOptimizer/dead_store_elim.sil @@ -198,7 +198,7 @@ bb0: sil @store_after_store : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = store %0 to %1a : $*B %4 = tuple() diff --git a/test/SILOptimizer/definite_init.sil b/test/SILOptimizer/definite_init.sil index edcaee8206d..40c78d33c2d 100644 --- a/test/SILOptimizer/definite_init.sil +++ b/test/SILOptimizer/definite_init.sil @@ -13,7 +13,7 @@ sil @makesInt : $@convention(thin) () -> Int sil @use_before_init : $@convention(thin) () -> Int { bb0: %0 = alloc_box $Int - %0a = project_box %0 : $@box Int + %0a = project_box %0 : $@box Int, 0 %1 = mark_uninitialized [var] %0a : $*Int // expected-note {{variable defined here}} %4 = load %1 : $*Int // expected-error {{variable '' used before being initialized}} strong_release %0 : $@box Int @@ -25,7 +25,7 @@ bb0: sil @inout_uninit : $@convention(thin) () -> () { bb0: %0 = alloc_box $Int - %0a = project_box %0 : $@box Int + %0a = project_box %0 : $@box Int, 0 %1 = mark_uninitialized [var] %0a : $*Int // expected-note {{variable defined here}} %5 = function_ref @takes_Int_inout : $@convention(thin) (@inout Int) -> () @@ -50,7 +50,7 @@ bb0: sil @used_by_inout : $@convention(thin) (Int) -> (Int, Int) { bb0(%0 : $Int): %91 = alloc_box $Int - %91a = project_box %91 : $@box Int + %91a = project_box %91 : $@box Int, 0 %1 = mark_uninitialized [var] %91a : $*Int %2 = store %0 to %1 : $*Int @@ -77,7 +77,7 @@ sil @returns_generic_struct : $@convention(thin) () -> @out AddressOnlyStruct sil @call_struct_return_function : $@convention(thin) () -> Int { bb0: %0 = alloc_box $AddressOnlyStruct - %0a = project_box %0 : $@box AddressOnlyStruct + %0a = project_box %0 : $@box AddressOnlyStruct, 0 %1 = mark_uninitialized [var] %0a : $*AddressOnlyStruct %2 = function_ref @returns_generic_struct : $@convention(thin) () -> @out AddressOnlyStruct @@ -93,7 +93,7 @@ bb0: sil @tuple_elements1 : $@convention(thin) (Int) -> () { bb0(%0 : $Int): %2 = alloc_box $(Int, Int) - %2a = project_box %2 : $@box (Int, Int) + %2a = project_box %2 : $@box (Int, Int), 0 %3 = mark_uninitialized [var] %2a : $*(Int, Int) // expected-note {{variable defined here}} %4 = tuple_element_addr %3 : $*(Int, Int), 0 %5 = tuple_element_addr %3 : $*(Int, Int), 1 @@ -110,7 +110,7 @@ bb0(%0 : $Int): sil @tuple_elements2 : $@convention(thin) (Int) -> (Int, Int) { bb0(%0 : $Int): %2 = alloc_box $(Int, Int) - %2a = project_box %2 : $@box (Int, Int) + %2a = project_box %2 : $@box (Int, Int), 0 %3 = mark_uninitialized [var] %2a : $*(Int, Int) // expected-note {{variable defined here}} %18 = tuple_element_addr %3 : $*(Int, Int), 0 store %0 to %18 : $*Int @@ -128,7 +128,7 @@ bb0(%0 : $Int): sil @copy_addr1 : $@convention(thin) (@in T) -> @out T { bb0(%0 : $*T, %1 : $*T): %3 = alloc_box $T - %3a = project_box %3 : $@box T + %3a = project_box %3 : $@box T, 0 %4 = mark_uninitialized [var] %3a : $*T copy_addr [take] %1 to [initialization] %4 : $*T copy_addr %4 to [initialization] %0 : $*T @@ -141,7 +141,7 @@ bb0(%0 : $*T, %1 : $*T): sil @copy_addr2 : $@convention(thin) (@in T) -> @out T { bb0(%0 : $*T, %1 : $*T): %3 = alloc_box $T - %3a = project_box %3 : $@box T + %3a = project_box %3 : $@box T, 0 %4 = mark_uninitialized [var] %3a : $*T // expected-note {{variable defined here}} copy_addr %4 to [initialization] %0 : $*T // expected-error {{variable '' used before being initialized}} strong_release %3 : $@box T @@ -157,7 +157,7 @@ sil @closure0 : $@convention(thin) (@owned @box Int) -> () sil @closure_test : $@convention(thin) () -> () { bb0: %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %0 = mark_uninitialized [var] %1a : $*Int // expected-note {{variable defined here}} %5 = function_ref @takes_closure : $@convention(thin) (@callee_owned () -> ()) -> () @@ -183,7 +183,7 @@ sil @getSomeOptionalClass : $@convention(thin) () -> Optional sil @assign_test_trivial : $@convention(thin) (Int) -> Int { bb0(%0 : $Int): %7 = alloc_box $Int - %7a = project_box %7 : $@box Int + %7a = project_box %7 : $@box Int, 0 %1 = mark_uninitialized [var] %7a : $*Int // These assigns are a mix of init + store forms, but because Int is trivial, @@ -205,7 +205,7 @@ bb0: // lone store), the second becomes an assignment (retain/release dance). %b = alloc_box $SomeClass - %ba = project_box %b : $@box SomeClass + %ba = project_box %b : $@box SomeClass, 0 %c = mark_uninitialized [var] %ba : $*SomeClass %f = function_ref @getSomeClass : $@convention(thin) () -> @owned SomeClass @@ -237,7 +237,7 @@ bb0: sil @assign_test_addressonly : $@convention(thin) (@in T) -> @out T { bb0(%0 : $*T, %1 : $*T): %b = alloc_box $T - %ba = project_box %b : $@box T + %ba = project_box %b : $@box T, 0 %2 = mark_uninitialized [var] %ba : $*T // CHECK: [[PB:%[0-9]+]] = project_box @@ -267,7 +267,7 @@ bb0: // second becomes an assignment. %b = alloc_box $@sil_weak Optional - %ba = project_box %b : $@box @sil_weak Optional + %ba = project_box %b : $@box @sil_weak Optional, 0 %c = mark_uninitialized [var] %ba : $*@sil_weak Optional // expected-note {{variable defined here}} // Invalid load to keep the alloc_box around so we can check init semantics. @@ -307,7 +307,7 @@ bb0: // second becomes an assignment. %b = alloc_box $@sil_unowned SomeClass - %ba = project_box %b : $@box @sil_unowned SomeClass + %ba = project_box %b : $@box @sil_unowned SomeClass, 0 %c = mark_uninitialized [var] %ba : $*@sil_unowned SomeClass %f = function_ref @getSomeClass : $@convention(thin) () -> @owned SomeClass @@ -359,7 +359,7 @@ struct ContainsNativeObject { sil @test_struct : $@convention(thin) (@inout ContainsNativeObject) -> () { bb0(%0 : $*ContainsNativeObject): %b = alloc_box $ContainsNativeObject - %ba = project_box %b : $@box ContainsNativeObject + %ba = project_box %b : $@box ContainsNativeObject, 0 %c = mark_uninitialized [var] %ba : $*ContainsNativeObject %1 = load %0 : $*ContainsNativeObject assign %1 to %c : $*ContainsNativeObject @@ -632,7 +632,7 @@ sil @superinit : $@convention(method) (@owned RootClassWithIVars) -> @owned Root sil @derived_test1 : $@convention(method) (@owned DerivedClassWithIVars) -> @owned DerivedClassWithIVars { bb0(%0 : $DerivedClassWithIVars): %1 = alloc_box $DerivedClassWithIVars - %1a = project_box %1 : $@box DerivedClassWithIVars + %1a = project_box %1 : $@box DerivedClassWithIVars, 0 %3 = mark_uninitialized [derivedself] %1a : $*DerivedClassWithIVars store %0 to %3 : $*DerivedClassWithIVars @@ -662,7 +662,7 @@ bb0(%0 : $DerivedClassWithIVars): sil @derived_test2 : $@convention(method) (@owned DerivedClassWithIVars) -> @owned DerivedClassWithIVars { bb0(%0 : $DerivedClassWithIVars): %1 = alloc_box $DerivedClassWithIVars - %1a = project_box %1 : $@box DerivedClassWithIVars + %1a = project_box %1 : $@box DerivedClassWithIVars, 0 %3 = mark_uninitialized [derivedself] %1a : $*DerivedClassWithIVars store %0 to %3 : $*DerivedClassWithIVars @@ -852,7 +852,7 @@ bb0(%0 : $DerivedClassWithNontrivialStoredProperties): sil @test_delegating_box_release : $@convention(method) (@owned RootClassWithNontrivialStoredProperties) -> () { bb0(%0 : $RootClassWithNontrivialStoredProperties): %2 = alloc_box $RootClassWithNontrivialStoredProperties - %2a = project_box %2 : $@box RootClassWithNontrivialStoredProperties + %2a = project_box %2 : $@box RootClassWithNontrivialStoredProperties, 0 %4 = mark_uninitialized [delegatingself] %2a : $*RootClassWithNontrivialStoredProperties store %0 to %4 : $*RootClassWithNontrivialStoredProperties strong_release %2 : $@box RootClassWithNontrivialStoredProperties @@ -876,7 +876,7 @@ bb0(%0 : $RootClassWithNontrivialStoredProperties): sil @test_delegating_rvalue_release : $@convention(method) (@owned RootClassWithNontrivialStoredProperties) -> () { bb0(%0 : $RootClassWithNontrivialStoredProperties): %2 = alloc_box $RootClassWithNontrivialStoredProperties - %2a = project_box %2 : $@box RootClassWithNontrivialStoredProperties + %2a = project_box %2 : $@box RootClassWithNontrivialStoredProperties, 0 %4 = mark_uninitialized [delegatingself] %2a : $*RootClassWithNontrivialStoredProperties store %0 to %4 : $*RootClassWithNontrivialStoredProperties %6 = load %4 : $*RootClassWithNontrivialStoredProperties @@ -913,7 +913,7 @@ bb0(%0 : $DerivedClassWithNontrivialStoredProperties): sil @super_init_out_of_order : $@convention(method) (@owned DerivedClassWithIVars, Int) -> @owned DerivedClassWithIVars { bb0(%0 : $DerivedClassWithIVars, %i : $Int): %1 = alloc_box $DerivedClassWithIVars - %1a = project_box %1 : $@box DerivedClassWithIVars + %1a = project_box %1 : $@box DerivedClassWithIVars, 0 %3 = mark_uninitialized [derivedself] %1a : $*DerivedClassWithIVars store %0 to %3 : $*DerivedClassWithIVars diff --git a/test/SILOptimizer/definite_init_crashes.sil b/test/SILOptimizer/definite_init_crashes.sil index 4e7fa505b9a..37e3f44762f 100644 --- a/test/SILOptimizer/definite_init_crashes.sil +++ b/test/SILOptimizer/definite_init_crashes.sil @@ -16,7 +16,7 @@ struct Triple { sil @TripleTest : $@convention(method) (Int, @inout Triple) -> Triple { bb0(%0 : $Int, %1 : $*Triple): %4 = alloc_box $Triple - %4a = project_box %4 : $@box Triple + %4a = project_box %4 : $@box Triple, 0 %5 = load %1 : $*Triple store %5 to %4a : $*Triple %8 = struct_element_addr %4a : $*Triple, #Triple.b @@ -35,7 +35,7 @@ struct Single { sil @SingleTest : $@convention(method) (@inout Single, Int) -> Single { bb0(%0 : $*Single, %1 : $Int): %4 = alloc_box $Single - %4a = project_box %4 : $@box Single + %4a = project_box %4 : $@box Single, 0 %5 = load %0 : $*Single store %5 to %4a : $*Single @@ -64,7 +64,7 @@ sil @test_union_release : $@convention(thin) () -> () { bb0: %0 = tuple () %1 = alloc_box $SomeUnion // users: %9, %8 - %1a = project_box %1 : $@box SomeUnion + %1a = project_box %1 : $@box SomeUnion, 0 %2 = function_ref @getSomeUnion : $@convention(thin) (@owned SomeClass, @thin SomeUnion.Type) -> @owned SomeUnion // user: %7 %3 = metatype $@thin SomeUnion.Type // user: %7 %4 = function_ref @getSomeClass : $@convention(thin) (@thick SomeClass.Type) -> @owned SomeClass // user: %6 diff --git a/test/SILOptimizer/diagnose_unreachable.sil b/test/SILOptimizer/diagnose_unreachable.sil index eebd62b834f..493707579d1 100644 --- a/test/SILOptimizer/diagnose_unreachable.sil +++ b/test/SILOptimizer/diagnose_unreachable.sil @@ -138,7 +138,7 @@ bb0: sil @removeTriviallyDeadInstructions : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B // CHECK: store %3 = load %1a : $*B %4 = strong_retain %3 : $B // CHECK: strong_retain diff --git a/test/SILOptimizer/escape_analysis.sil b/test/SILOptimizer/escape_analysis.sil index 5948268a34c..649c6ffd42e 100644 --- a/test/SILOptimizer/escape_analysis.sil +++ b/test/SILOptimizer/escape_analysis.sil @@ -398,10 +398,10 @@ sil @call_copy_addr_content : $@convention(thin) () -> () { sil @test_partial_apply : $@convention(thin) (Int64, @owned X, @owned Y) -> Int64 { bb0(%0 : $Int64, %1 : $X, %2 : $Y): %3 = alloc_box $Int64 - %4 = project_box %3 : $@box Int64 + %4 = project_box %3 : $@box Int64, 0 store %0 to %4 : $*Int64 %6 = alloc_box $Y - %7 = project_box %6 : $@box Y + %7 = project_box %6 : $@box Y, 0 store %2 to %7 : $*Y %9 = function_ref @closure1 : $@convention(thin) (@owned X, @owned @box Int64, @owned @box Y) -> Int64 strong_retain %3 : $@box Int64 @@ -429,8 +429,8 @@ bb0(%0 : $Int64, %1 : $X, %2 : $Y): // CHECK-NEXT: End sil @closure1 : $@convention(thin) (@owned X, @owned @box Int64, @owned @box Y) -> Int64 { bb0(%0 : $X, %1 : $@box Int64, %2 : $@box Y): - %3 = project_box %1 : $@box Int64 - %4 = project_box %2 : $@box Y + %3 = project_box %1 : $@box Int64, 0 + %4 = project_box %2 : $@box Y, 0 %5 = load %3 : $*Int64 %6 = function_ref @closure2 : $@convention(thin) (@owned X, @owned @box Y) -> () %7 = partial_apply %6(%2) : $@convention(thin) (@owned X, @owned @box Y) -> () @@ -449,7 +449,7 @@ bb0(%0 : $X, %1 : $@box Int64, %2 : $@box Y): // CHECK-NEXT: End sil @closure2 : $@convention(thin) (@owned X, @owned @box Y) -> () { bb0(%0 : $X, %1 : $@box Y): - %2 = project_box %1 : $@box Y + %2 = project_box %1 : $@box Y, 0 %3 = load %2 : $*Y %4 = ref_element_addr %3 : $Y, #Y.x store %0 to %4 : $*X @@ -470,7 +470,7 @@ bb0(%0 : $X, %1 : $@box Y): sil @test_escaped_box : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %2 = project_box %1 : $@box Int64 + %2 = project_box %1 : $@box Int64, 0 store %0 to %2 : $*Int64 %4 = function_ref @let_box_escape : $@convention(thin) (@owned @box Int64) -> Int64 @@ -491,7 +491,7 @@ bb0(%0 : $Int64): // CHECK-NEXT: End sil @let_box_escape : $@convention(thin) (@owned @box Int64) -> Int64 { bb0(%0 : $@box Int64): - %1 = project_box %0 : $@box Int64 + %1 = project_box %0 : $@box Int64, 0 %2 = load %1 : $*Int64 %3 = function_ref @takebox : $@convention(thin) (@owned @box Int64) -> () @@ -513,7 +513,7 @@ sil @takebox : $@convention(thin) (@owned @box Int64) -> () sil @test_escaped_partial_apply : $@convention(thin) (Int64) -> () { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %2 = project_box %1 : $@box Int64 + %2 = project_box %1 : $@box Int64, 0 store %0 to %2 : $*Int64 %4 = function_ref @closure3 : $@convention(thin) (@owned @box Int64) -> Int64 strong_retain %1 : $@box Int64 @@ -533,7 +533,7 @@ bb0(%0 : $Int64): // CHECK-NEXT: End sil @closure3 : $@convention(thin) (@owned @box Int64) -> Int64 { bb0(%0 : $@box Int64): - %1 = project_box %0 : $@box Int64 + %1 = project_box %0 : $@box Int64, 0 %2 = load %1 : $*Int64 strong_release %0 : $@box Int64 return %2 : $Int64 @@ -750,7 +750,7 @@ sil @unknown_throwing_func : $@convention(thin) (@owned X) -> (@owned X, @error sil @test_release_of_partial_apply_with_box : $@convention(thin) (@owned Y) -> () { bb0(%0 : $Y): %1 = alloc_box $Y - %2 = project_box %1 : $@box Y + %2 = project_box %1 : $@box Y, 0 store %0 to %2 : $*Y %3 = function_ref @take_y_box : $@convention(thin) (@owned @box Y) -> () %4 = partial_apply %3(%1) : $@convention(thin) (@owned @box Y) -> () diff --git a/test/SILOptimizer/looprotate.sil b/test/SILOptimizer/looprotate.sil index 5bd953224ee..9ff2bc15712 100644 --- a/test/SILOptimizer/looprotate.sil +++ b/test/SILOptimizer/looprotate.sil @@ -46,7 +46,7 @@ bb0(%0 : $Int32, %25: $Bar): %1 = struct_extract %0 : $Int32, #Int32._value %2 = integer_literal $Builtin.Int32, 0 %30 = alloc_box $Bool - %30a = project_box %30 : $@box Bool + %30a = project_box %30 : $@box Bool, 0 br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $Bar, %30 : $@box Bool, %30a : $*Bool) bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $Bar, %31 : $@box Bool, %32 : $*Bool): @@ -121,7 +121,7 @@ bb0(%0 : $Int32, %25: $*P): %1 = struct_extract %0 : $Int32, #Int32._value %2 = integer_literal $Builtin.Int32, 0 %30 = alloc_box $Bool - %30a = project_box %30 : $@box Bool + %30a = project_box %30 : $@box Bool, 0 %40 = open_existential_addr %25 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83") P br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $*P, %30 : $@box Bool, %30a : $*Bool) diff --git a/test/SILOptimizer/lslocation_expansion.sil b/test/SILOptimizer/lslocation_expansion.sil index 5d7838a9d75..30b079b1707 100644 --- a/test/SILOptimizer/lslocation_expansion.sil +++ b/test/SILOptimizer/lslocation_expansion.sil @@ -93,7 +93,7 @@ sil @stack_store : $@convention(thin) () -> () { sil @store_after_store : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = store %0 to %1a : $*B %4 = tuple() diff --git a/test/SILOptimizer/lslocation_reduction.sil b/test/SILOptimizer/lslocation_reduction.sil index 8249812cd81..1daecae2b4f 100644 --- a/test/SILOptimizer/lslocation_reduction.sil +++ b/test/SILOptimizer/lslocation_reduction.sil @@ -93,7 +93,7 @@ sil @stack_store : $@convention(thin) () -> () { sil @store_after_store : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = store %0 to %1a : $*B %4 = tuple() diff --git a/test/SILOptimizer/mandatory_inlining.sil b/test/SILOptimizer/mandatory_inlining.sil index 6cf6f84551f..9cede619821 100644 --- a/test/SILOptimizer/mandatory_inlining.sil +++ b/test/SILOptimizer/mandatory_inlining.sil @@ -28,7 +28,7 @@ sil @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int6 sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 store %0 to %1a : $*Int64 %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64 %4 = load %1a : $*Int64 @@ -76,7 +76,7 @@ sil @inline_test_add : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 store %0 to %1a : $*Int64 %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64 %4 = function_ref @test_add : $@convention(thin) (Int64) -> Int64 @@ -143,7 +143,7 @@ sil @inline_twice_test_add : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 store %0 to %1a : $*Int64 %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64 %4 = function_ref @test_add : $@convention(thin) (Int64) -> Int64 @@ -173,7 +173,7 @@ protocol SomeProtocol { sil [transparent] @test_existential_metatype : $@convention(thin) (@in SomeProtocol) -> @thick SomeProtocol.Type { bb0(%0 : $*SomeProtocol): %1 = alloc_box $SomeProtocol - %1a = project_box %1 : $@box SomeProtocol + %1a = project_box %1 : $@box SomeProtocol, 0 copy_addr [take] %0 to [initialization] %1a : $*SomeProtocol %4 = alloc_stack $SomeProtocol copy_addr %1a to [initialization] %4 : $*SomeProtocol @@ -222,9 +222,9 @@ sil @bar : $@convention(thin) (Float32) -> Bool sil [transparent] @test_control_flow : $@convention(thin) (Float, Float) -> Float { bb0(%0 : $Float, %1 : $Float): %2 = alloc_box $Float - %2a = project_box %2 : $@box Float + %2a = project_box %2 : $@box Float, 0 %3 = alloc_box $Float - %3a = project_box %3 : $@box Float + %3a = project_box %3 : $@box Float, 0 store %0 to %2a : $*Float store %1 to %3a : $*Float %6 = function_ref @get_logic_value : $@convention(method) (@inout Bool) -> Builtin.Int1 @@ -362,7 +362,7 @@ sil @inline_test_control_flow : $@convention(thin) (Float) -> Float { bb0(%0 : $Float): %1 = alloc_box $Float - %1a = project_box %1 : $@box Float + %1a = project_box %1 : $@box Float, 0 store %0 to %1a : $*Float %3 = function_ref @sub_floats : $@convention(thin) (Float, Float) -> Float %4 = function_ref @test_control_flow : $@convention(thin) (Float, Float) -> Float @@ -454,9 +454,9 @@ sil @true_getter : $@convention(thin) () -> Bool sil [transparent] @short_circuit_or : $@convention(thin) (Bool, @callee_owned () -> Bool) -> Bool { bb0(%0 : $Bool, %1 : $@callee_owned () -> Bool): %2 = alloc_box $Bool - %2a = project_box %2 : $@box Bool + %2a = project_box %2 : $@box Bool, 0 %3 = alloc_box $@callee_owned () -> Bool - %3a = project_box %3 : $@box @callee_owned () -> Bool + %3a = project_box %3 : $@box @callee_owned () -> Bool, 0 store %0 to %2a : $*Bool store %1 to %3a : $*@callee_owned () -> Bool %6 = function_ref @get_logic_value : $@convention(method) (@inout Bool) -> Builtin.Int1 @@ -483,7 +483,7 @@ bb3(%16 : $Bool): sil private [transparent] @closure0 : $@convention(thin) (@owned @box Bool) -> Bool { bb0(%0 : $@box Bool): - %1 = project_box %0 : $@box Bool + %1 = project_box %0 : $@box Bool, 0 %2 = tuple () %3 = load %1 : $*Bool strong_release %0 : $@box Bool @@ -516,9 +516,9 @@ sil @test_short_circuit : $@convention(thin) (Bool, Bool) -> Bool { bb0(%0 : $Bool, %1 : $Bool): %2 = alloc_box $Bool - %2a = project_box %2 : $@box Bool + %2a = project_box %2 : $@box Bool, 0 %3 = alloc_box $Bool - %3a = project_box %3 : $@box Bool + %3a = project_box %3 : $@box Bool, 0 store %0 to %2a : $*Bool store %1 to %3a : $*Bool %6 = function_ref @short_circuit_or : $@convention(thin) (Bool, @callee_owned () -> Bool) -> Bool @@ -558,9 +558,9 @@ sil @test_short_circuit2 : $@convention(thin) (Bool, Bool) -> Bool { bb0(%0 : $Bool, %1 : $Bool): %2 = alloc_box $Bool - %2a = project_box %2 : $@box Bool + %2a = project_box %2 : $@box Bool, 0 %3 = alloc_box $Bool - %3a = project_box %3 : $@box Bool + %3a = project_box %3 : $@box Bool, 0 store %0 to %2a : $*Bool store %1 to %3a : $*Bool %6 = function_ref @short_circuit_or : $@convention(thin) (Bool, @callee_owned () -> Bool) -> Bool @@ -591,7 +591,7 @@ sil @test_with_dead_argument : $@convention(thin) () -> () { bb0: %0 = tuple () %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 %2 = function_ref @convertFromBuiltinIntegerLiteral : $@convention(thin) (Builtin.Int2048, @thin Int64.Type) -> Int64 %3 = metatype $@thin Int64.Type %4 = integer_literal $Builtin.Int2048, 1 diff --git a/test/SILOptimizer/mem2reg.sil b/test/SILOptimizer/mem2reg.sil index cf952034460..ee9d10cccb8 100644 --- a/test/SILOptimizer/mem2reg.sil +++ b/test/SILOptimizer/mem2reg.sil @@ -54,7 +54,7 @@ bb0(%0 : $Int64): %1 = alloc_stack $Int64, var, name "c" // users: %19, %2 store %0 to %1 : $*Int64 // id: %2 %3 = alloc_box $Int64, var, name "x" // users: %16, %11, %6 - %3a = project_box %3 : $@box Int64 + %3a = project_box %3 : $@box Int64, 0 %4 = integer_literal $Builtin.Int64, 2 // users: %9, %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // users: %12, %6 store %5 to %3a : $*Int64 // id: %6 @@ -85,7 +85,7 @@ bb0(%0 : $Int64): %1 = alloc_stack $Int64, var, name "c" // users: %19, %2, (%20) store %0 to %1 : $*Int64 // id: %2 %3 = alloc_box $Int64, var, name "x" // users: %16, %11, %6 - %3a = project_box %3 : $@box Int64 + %3a = project_box %3 : $@box Int64, 0 %4 = integer_literal $Builtin.Int64, 2 // users: %9, %5 %5 = struct $Int64 (%4 : $Builtin.Int64) // users: %12, %6 store %5 to %3a : $*Int64 // id: %6 diff --git a/test/SILOptimizer/predictable_memopt.sil b/test/SILOptimizer/predictable_memopt.sil index 4008e2a6f19..2386133d3b6 100644 --- a/test/SILOptimizer/predictable_memopt.sil +++ b/test/SILOptimizer/predictable_memopt.sil @@ -8,10 +8,10 @@ import Swift sil @simple_reg_promotion : $@convention(thin) (Int) -> Int { bb0(%0 : $Int): // CHECK: bb0(%0 : $Int): %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 store %0 to %1a : $*Int %3 = alloc_box $Int - %3a = project_box %3 : $@box Int + %3a = project_box %3 : $@box Int, 0 %4 = load %1a : $*Int store %4 to %3a : $*Int %6 = load %3a : $*Int @@ -27,7 +27,7 @@ bb0(%0 : $Int): // CHECK: bb0(%0 : $Int): sil @tuple_reg_promotion : $@convention(thin) (Int) -> Int { bb0(%0 : $Int): // CHECK: bb0(%0 : $Int): %1 = alloc_box $(Int, Int) - %1a = project_box %1 : $@box (Int, Int) + %1a = project_box %1 : $@box (Int, Int), 0 %a = tuple_element_addr %1a : $*(Int, Int), 0 %b = tuple_element_addr %1a : $*(Int, Int), 1 @@ -67,7 +67,7 @@ bb0(%0 : $Int): // This alloc_stack can't be removed since it is used by an inout call. // CHECK: %1 = alloc_box $Int %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 %2 = store %0 to %1a : $*Int // This load should be eliminated. @@ -105,7 +105,7 @@ sil @closure0 : $@convention(thin) (@owned @box Int) -> () sil @closure_test2 : $@convention(thin) (Int) -> Int { bb0(%1 : $Int): %0 = alloc_box $Int - %0a = project_box %0 : $@box Int + %0a = project_box %0 : $@box Int, 0 store %1 to %0a : $*Int // CHECK: store %5 = function_ref @takes_closure : $@convention(thin) (@callee_owned () -> ()) -> () @@ -133,7 +133,7 @@ sil @getSomeClass : $@convention(thin) () -> @owned SomeClass sil @assign_test_trivial : $@convention(thin) (Int) -> Int { bb0(%0 : $Int): %1 = alloc_box $Int - %1a = project_box %1 : $@box Int + %1a = project_box %1 : $@box Int, 0 store %0 to %1a : $*Int store %0 to %1a : $*Int @@ -378,7 +378,7 @@ entry(%x : $Int): // CHECK: [[BOX:%.*]] = alloc_box $Int %b = alloc_box $Int // CHECK: [[PB:%.*]] = project_box [[BOX]] - %ba = project_box %b : $@box Int + %ba = project_box %b : $@box Int, 0 // CHECK: store [[X]] to [[PB]] store %x to %ba : $*Int // CHECK: [[E:%.*]] = enum $IndirectCase, #IndirectCase.X!enumelt.1, [[BOX]] : $@box Int diff --git a/test/SILOptimizer/redundant_load_elim.sil b/test/SILOptimizer/redundant_load_elim.sil index 537eb6ba5b7..0aa5667bff8 100644 --- a/test/SILOptimizer/redundant_load_elim.sil +++ b/test/SILOptimizer/redundant_load_elim.sil @@ -305,7 +305,7 @@ bb0(%0 : $Agg1): sil @store_promotion : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = load %1a : $*B %4 = load %1a : $*B @@ -940,8 +940,8 @@ bb10: // Preds: bb7 bb8 bb9 // CHECK: return [[TP]] sil @test_project_box : $@convention(thin) (@box Builtin.Int32) -> (Builtin.Int32, Builtin.Int32) { bb0(%0 : $@box Builtin.Int32): - %2 = project_box %0 : $@box Builtin.Int32 - %3 = project_box %0 : $@box Builtin.Int32 + %2 = project_box %0 : $@box Builtin.Int32, 0 + %3 = project_box %0 : $@box Builtin.Int32, 0 %4 = load %2 : $*Builtin.Int32 %5 = load %3 : $*Builtin.Int32 diff --git a/test/SILOptimizer/redundant_load_elim_with_casts.sil b/test/SILOptimizer/redundant_load_elim_with_casts.sil index 1d483d5670f..c93ed3a7d3b 100644 --- a/test/SILOptimizer/redundant_load_elim_with_casts.sil +++ b/test/SILOptimizer/redundant_load_elim_with_casts.sil @@ -73,7 +73,7 @@ struct Wrapper { sil @tbaa_class_alias_nonclass : $@convention(thin) (@owned B, @inout Agg1) -> () { bb0(%0 : $B, %1 : $*Agg1): %2 = alloc_box $B - %2a = project_box %2 : $@box B + %2a = project_box %2 : $@box B, 0 %3 = load %1 : $*Agg1 %4 = store %3 to %1 : $*Agg1 %5 = load %2a : $*B diff --git a/test/SILOptimizer/side-effect.sil b/test/SILOptimizer/side-effect.sil index 80eae0365e0..130e9fc01ac 100644 --- a/test/SILOptimizer/side-effect.sil +++ b/test/SILOptimizer/side-effect.sil @@ -177,7 +177,7 @@ bb0(%0 : $Int32): %l1 = load %a : $*Int32 %b = alloc_box $Int32 - %ba = project_box %b : $@box Int32 + %ba = project_box %b : $@box Int32, 0 store %0 to %ba : $*Int32 %l2 = load %ba : $*Int32 @@ -279,7 +279,7 @@ bb0(%0 : $Int32): // CHECK: sil @test_project_box : $@convention(thin) (@box Builtin.Int32) -> Builtin.Int32 { bb0(%0 : $@box Builtin.Int32): - %a = project_box %0 : $@box Builtin.Int32 + %a = project_box %0 : $@box Builtin.Int32, 0 %l = load %a : $*Builtin.Int32 return %l : $Builtin.Int32 } diff --git a/test/SILOptimizer/sil_combine.sil b/test/SILOptimizer/sil_combine.sil index 86f62e81434..ce92a3f31cb 100644 --- a/test/SILOptimizer/sil_combine.sil +++ b/test/SILOptimizer/sil_combine.sil @@ -143,7 +143,7 @@ bb0: sil @removeTriviallyDeadInstructions : $@convention(thin) (@owned B) -> () { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = load %1a : $*B %4 = strong_retain %3 : $B diff --git a/test/SILOptimizer/sil_locations.sil b/test/SILOptimizer/sil_locations.sil index 594cc6fd51d..513797667b4 100644 --- a/test/SILOptimizer/sil_locations.sil +++ b/test/SILOptimizer/sil_locations.sil @@ -10,7 +10,7 @@ sil @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int6 sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 store %0 to %1a : $*Int64 %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64 %4 = load %1a : $*Int64 @@ -26,7 +26,7 @@ bb0(%0 : $Int64): sil @inline_test_add : $@convention(thin) (Int64) -> Int64 { bb0(%0 : $Int64): %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 store %0 to %1a : $*Int64 %3 = function_ref @plus : $@convention(thin) (Int64, Int64) -> Int64 %4 = function_ref @test_add : $@convention(thin) (Int64) -> Int64 diff --git a/test/SILOptimizer/simplify_cfg.sil b/test/SILOptimizer/simplify_cfg.sil index 74113f240ba..86dda33482d 100644 --- a/test/SILOptimizer/simplify_cfg.sil +++ b/test/SILOptimizer/simplify_cfg.sil @@ -2633,7 +2633,7 @@ bb2(%16 : $Error): sil @simplified_branch_arg_has_result_value_1 : $@convention(thin) (@in Builtin.Int32) -> Builtin.Int32 { entry(%0 : $*Builtin.Int32): %b = alloc_box $Builtin.Int32 - %p = project_box %b : $@box Builtin.Int32 + %p = project_box %b : $@box Builtin.Int32, 0 %i = integer_literal $Builtin.Int32, 0 store %i to %p : $*Builtin.Int32 br bb1(%p : $*Builtin.Int32) diff --git a/test/SILOptimizer/specialize.sil b/test/SILOptimizer/specialize.sil index 37fdb8859c4..2f0dc778755 100644 --- a/test/SILOptimizer/specialize.sil +++ b/test/SILOptimizer/specialize.sil @@ -167,7 +167,7 @@ bb0(%0 : $*T): // function_ref specialize.(getGenericClosure (t : A) -> () -> A).(tmp #1) (())A %2 = function_ref @_TFF10specialize17getGenericClosureU__FT1tQ__FT_Q_L_3tmpfT_Q_ : $@convention(thin) <τ_0_0> (@owned @box τ_0_0) -> @out τ_0_0 // user: %5 %3 = alloc_box $T // users: %4, %5, %5 - %3a = project_box %3 : $@box T + %3a = project_box %3 : $@box T, 0 copy_addr %0 to [initialization] %3a : $*T // id: %4 %5 = partial_apply %2(%3) : $@convention(thin) <τ_0_0> (@owned @box τ_0_0) -> @out τ_0_0 // user: %7 destroy_addr %0 : $*T // id: %6 @@ -177,7 +177,7 @@ bb0(%0 : $*T): // specialize.(getGenericClosure (t : A) -> () -> A).(tmp #1) (()) sil shared @_TFF10specialize17getGenericClosureU__FT1tQ__FT_Q_L_3tmpfT_Q_ : $@convention(thin) (@owned @box T) -> @out T { bb0(%0 : $*T, %1 : $@box T): - %2 = project_box %1 : $@box T + %2 = project_box %1 : $@box T, 0 copy_addr %2 to [initialization] %0 : $*T // id: %3 strong_release %1 : $@box T // id: %4 %5 = tuple () // user: %6 @@ -297,7 +297,7 @@ bb0(%0 : $*U): // 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 - %3a = project_box %3 : $@box U + %3a = project_box %3 : $@box U, 0 copy_addr %0 to [initialization] %3a : $*U // id: %4 %5 = partial_apply %2(%3) : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : P> (Int32, @in τ_0_1, @owned @box τ_0_0) -> Int32 // user: %7 destroy_addr %0 : $*U // id: %6 @@ -307,7 +307,7 @@ bb0(%0 : $*U): // test4.(boo (A) -> (Swift.Int32, B) -> Swift.Int32).(closure #1) 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 + %3 = project_box %2 : $@box U, 0 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 @@ -375,7 +375,7 @@ bb0(%0 : $*T): // 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 - %3a = project_box %3 : $@box T + %3a = project_box %3 : $@box T, 0 copy_addr %0 to [initialization] %3a : $*T // id: %4 %5 = partial_apply %2(%3) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (Int32, @owned @box τ_0_0) -> Int32 // user: %7 destroy_addr %0 : $*T // id: %6 @@ -385,7 +385,7 @@ bb0(%0 : $*T): // test4.(gen1 (A) -> (Swift.Int32) -> Swift.Int32).(closure #1) 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 + %2 = project_box %1 : $@box T, 0 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 diff --git a/test/SILOptimizer/specialize_metatypes_with_nondefault_representation.sil b/test/SILOptimizer/specialize_metatypes_with_nondefault_representation.sil index 77051889b62..306053a72e5 100644 --- a/test/SILOptimizer/specialize_metatypes_with_nondefault_representation.sil +++ b/test/SILOptimizer/specialize_metatypes_with_nondefault_representation.sil @@ -37,18 +37,18 @@ sil @tmp2 : $@convention(thin) () -> () { bb0: %0 = function_ref @tmp : $@convention(thin) () -> (@out T) %1 = alloc_box $@thick AnyObject.Type - %1a = project_box %1 : $@box @thick AnyObject.Type + %1a = project_box %1 : $@box @thick AnyObject.Type, 0 %2 = alloc_box $@objc_metatype AnyObject.Type - %2a = project_box %2 : $@box @objc_metatype AnyObject.Type + %2a = project_box %2 : $@box @objc_metatype AnyObject.Type, 0 %4 = apply %0<@thick AnyObject.Type>(%1a) : $@convention(thin) () -> (@out T) %5 = apply %0<@objc_metatype AnyObject.Type>(%2a) : $@convention(thin) () -> (@out T) %6 = alloc_box $@thick Builtin.Int32.Type - %6a = project_box %6 : $@box @thick Builtin.Int32.Type + %6a = project_box %6 : $@box @thick Builtin.Int32.Type, 0 %7 = alloc_box $@objc_metatype Builtin.Int32.Type - %7a = project_box %7 : $@box @objc_metatype Builtin.Int32.Type + %7a = project_box %7 : $@box @objc_metatype Builtin.Int32.Type, 0 %8 = alloc_box $@thin Builtin.Int32.Type - %8a = project_box %8 : $@box @thin Builtin.Int32.Type + %8a = project_box %8 : $@box @thin Builtin.Int32.Type, 0 %9 = apply %0<@thick Builtin.Int32.Type>(%6a) : $@convention(thin) () -> (@out T) %10 = apply %0<@objc_metatype Builtin.Int32.Type>(%7a) : $@convention(thin) () -> (@out T) %11 = apply %0<@thin Builtin.Int32.Type>(%8a) : $@convention(thin) () -> (@out T) diff --git a/test/SILOptimizer/split_critical_edges.sil b/test/SILOptimizer/split_critical_edges.sil index 89a68599a4b..ad707e38731 100644 --- a/test/SILOptimizer/split_critical_edges.sil +++ b/test/SILOptimizer/split_critical_edges.sil @@ -126,7 +126,7 @@ bb0(%0 : $AnyObject, %10: $Builtin.Int1): lookup1: %1 = alloc_box $AnyObject - %1a = project_box %1 : $@box AnyObject + %1a = project_box %1 : $@box AnyObject, 0 store %0 to %1a : $*AnyObject %3 = alloc_box $Optional<() -> ()> %4 = load %1a : $*AnyObject @@ -137,7 +137,7 @@ lookup1: lookup2: %21 = alloc_box $AnyObject - %21a = project_box %21 : $@box AnyObject + %21a = project_box %21 : $@box AnyObject, 0 store %0 to %21a : $*AnyObject %23 = alloc_box $Optional<() -> ()> %24 = load %21a : $*AnyObject diff --git a/test/SILOptimizer/typed-access-tb-aa.sil b/test/SILOptimizer/typed-access-tb-aa.sil index 7a14432079a..4b9e1c26d33 100644 --- a/test/SILOptimizer/typed-access-tb-aa.sil +++ b/test/SILOptimizer/typed-access-tb-aa.sil @@ -87,56 +87,56 @@ bb0: // Check that a raw pointer address may alias everything. // CHECK: PAIR #134. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #135. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #136. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #137. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #138. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #139. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #140. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #141. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #142. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #143. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #144. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #145. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #146. -// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer -// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %7 = project_box %0 : $@box Builtin.RawPointer, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: MayAlias // Now check that a native object address may: @@ -150,178 +150,178 @@ bb0: // 4. May alias addresses to other Builtin.NativeObjects // CHECK: PAIR #149. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #150. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #151. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #152. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #153. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #154. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #155. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #156. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #157. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #158. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #159. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #160. -// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject -// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %8 = project_box %1 : $@box Builtin.NativeObject, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // Check that unknown object addresses may only alias raw pointer addresses and // other unknown object addresses. Anything else should be no alias. // CHECK: PAIR #163. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #164. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #165. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #166. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #167. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #168. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #169. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #170. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #171. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #172. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #173. -// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject -// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %9 = project_box %2 : $@box Builtin.UnknownObject, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // Next check that Int8 addresses can only alias Int8 addresses and raw // pointers. This includes ensuring that Int8 cannot alias Int32 addresses. // CHECK: PAIR #176. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %11 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #177. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #178. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #179. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #180. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #181. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #182. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #183. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #184. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #185. -// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8 -// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %10 = project_box %3 : $@box Builtin.Int8, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // Finally conclude by checking that FPIEEE32 addresses only can alias raw // pointer addresses and other FPIEEE32 addresses. Again this includes proving // that FPIEEE64 addresses cannot alias FPIEEE32. // CHECK: PAIR #199. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #200. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #201. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #202. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #203. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #204. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #205. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #206. -// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32 -// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64 +// CHECK-NEXT: %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 // CHECK-NEXT: NoAlias sil @builtin_test : $@convention(thin) () -> () { @@ -334,25 +334,25 @@ bb0: %5 = alloc_box $Builtin.FPIEEE32 %6 = alloc_box $Builtin.FPIEEE64 - %7 = project_box %0 : $@box Builtin.RawPointer - %8 = project_box %1 : $@box Builtin.NativeObject - %9 = project_box %2 : $@box Builtin.UnknownObject - %10 = project_box %3 : $@box Builtin.Int8 - %11 = project_box %4 : $@box Builtin.Int32 - %12 = project_box %5 : $@box Builtin.FPIEEE32 - %13 = project_box %6 : $@box Builtin.FPIEEE64 + %7 = project_box %0 : $@box Builtin.RawPointer, 0 + %8 = project_box %1 : $@box Builtin.NativeObject, 0 + %9 = project_box %2 : $@box Builtin.UnknownObject, 0 + %10 = project_box %3 : $@box Builtin.Int8, 0 + %11 = project_box %4 : $@box Builtin.Int32, 0 + %12 = project_box %5 : $@box Builtin.FPIEEE32, 0 + %13 = project_box %6 : $@box Builtin.FPIEEE64, 0 // This second block ensures that we gain the benefits of not repeating // already known values with being able to have associated with the output for // each type each of the items we are trying to check aliasing against. This // makes it simpler to write these tests. - %14 = project_box %0 : $@box Builtin.RawPointer - %15 = project_box %1 : $@box Builtin.NativeObject - %16 = project_box %2 : $@box Builtin.UnknownObject - %17 = project_box %3 : $@box Builtin.Int8 - %18 = project_box %4 : $@box Builtin.Int32 - %19 = project_box %5 : $@box Builtin.FPIEEE32 - %20 = project_box %6 : $@box Builtin.FPIEEE64 + %14 = project_box %0 : $@box Builtin.RawPointer, 0 + %15 = project_box %1 : $@box Builtin.NativeObject, 0 + %16 = project_box %2 : $@box Builtin.UnknownObject, 0 + %17 = project_box %3 : $@box Builtin.Int8, 0 + %18 = project_box %4 : $@box Builtin.Int32, 0 + %19 = project_box %5 : $@box Builtin.FPIEEE32, 0 + %20 = project_box %6 : $@box Builtin.FPIEEE64, 0 %21 = tuple() return %21 : $() @@ -367,52 +367,52 @@ bb0: // CHECK-LABEL: @struct_tests // CHECK: PAIR #339. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %14 = project_box %0 : $@box STest_S1 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box STest_S1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #340. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %15 = project_box %1 : $@box STest_S2 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box STest_S2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #341. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %16 = project_box %2 : $@box STest_E1 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box STest_E1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #342. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %17 = project_box %3 : $@box STest_E2 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box STest_E2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #343. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %18 = project_box %4 : $@box STest_C1 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box STest_C1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #344. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %19 = project_box %5 : $@box STest_C2 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box STest_C2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #345. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %20 = project_box %6 : $@box STest_S3 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box STest_S3, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #351. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %26 = project_box %21 : $@box Builtin.RawPointer +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %26 = project_box %21 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #352. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %27 = project_box %22 : $@box Builtin.NativeObject +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %27 = project_box %22 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #353. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %28 = project_box %23 : $@box Builtin.UnknownObject +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %28 = project_box %23 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #354. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %29 = project_box %24 : $@box Builtin.Int32 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %29 = project_box %24 : $@box Builtin.Int32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #355. -// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3 -// CHECK-NEXT: %30 = project_box %25 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %13 = project_box %6 : $@box STest_S3, 0 +// CHECK-NEXT: %30 = project_box %25 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias struct STest_S1 { @@ -455,21 +455,21 @@ sil @struct_tests : $@convention(thin) () -> () { %5 = alloc_box $STest_C2 %6 = alloc_box $STest_S3 - %7 = project_box %0 : $@box STest_S1 - %8 = project_box %1 : $@box STest_S2 - %9 = project_box %2 : $@box STest_E1 - %10 = project_box %3 : $@box STest_E2 - %11 = project_box %4 : $@box STest_C1 - %12 = project_box %5 : $@box STest_C2 - %13 = project_box %6 : $@box STest_S3 + %7 = project_box %0 : $@box STest_S1, 0 + %8 = project_box %1 : $@box STest_S2, 0 + %9 = project_box %2 : $@box STest_E1, 0 + %10 = project_box %3 : $@box STest_E2, 0 + %11 = project_box %4 : $@box STest_C1, 0 + %12 = project_box %5 : $@box STest_C2, 0 + %13 = project_box %6 : $@box STest_S3, 0 - %14 = project_box %0 : $@box STest_S1 - %15 = project_box %1 : $@box STest_S2 - %16 = project_box %2 : $@box STest_E1 - %17 = project_box %3 : $@box STest_E2 - %18 = project_box %4 : $@box STest_C1 - %19 = project_box %5 : $@box STest_C2 - %20 = project_box %6 : $@box STest_S3 + %14 = project_box %0 : $@box STest_S1, 0 + %15 = project_box %1 : $@box STest_S2, 0 + %16 = project_box %2 : $@box STest_E1, 0 + %17 = project_box %3 : $@box STest_E2, 0 + %18 = project_box %4 : $@box STest_C1, 0 + %19 = project_box %5 : $@box STest_C2, 0 + %20 = project_box %6 : $@box STest_S3, 0 %21 = alloc_box $Builtin.RawPointer %22 = alloc_box $Builtin.NativeObject @@ -477,11 +477,11 @@ sil @struct_tests : $@convention(thin) () -> () { %24 = alloc_box $Builtin.Int32 %25 = alloc_box $Builtin.FPIEEE32 - %26 = project_box %21 : $@box Builtin.RawPointer - %27 = project_box %22 : $@box Builtin.NativeObject - %28 = project_box %23 : $@box Builtin.UnknownObject - %29 = project_box %24 : $@box Builtin.Int32 - %30 = project_box %25 : $@box Builtin.FPIEEE32 + %26 = project_box %21 : $@box Builtin.RawPointer, 0 + %27 = project_box %22 : $@box Builtin.NativeObject, 0 + %28 = project_box %23 : $@box Builtin.UnknownObject, 0 + %29 = project_box %24 : $@box Builtin.Int32, 0 + %30 = project_box %25 : $@box Builtin.FPIEEE32, 0 %9999 = tuple() return %9999 : $() @@ -489,52 +489,52 @@ sil @struct_tests : $@convention(thin) () -> () { // CHECK-LABEL: @enum_tests // CHECK: PAIR #339. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %14 = project_box %0 : $@box ETest_S1 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %14 = project_box %0 : $@box ETest_S1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #340. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %15 = project_box %1 : $@box ETest_S2 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %15 = project_box %1 : $@box ETest_S2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #341. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %16 = project_box %2 : $@box ETest_E1 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %16 = project_box %2 : $@box ETest_E1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #342. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %17 = project_box %3 : $@box ETest_E2 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %17 = project_box %3 : $@box ETest_E2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #343. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %18 = project_box %4 : $@box ETest_C1 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %18 = project_box %4 : $@box ETest_C1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #344. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %19 = project_box %5 : $@box ETest_C2 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %19 = project_box %5 : $@box ETest_C2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #345. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %20 = project_box %6 : $@box ETest_E3 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %20 = project_box %6 : $@box ETest_E3, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #351. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %26 = project_box %21 : $@box Builtin.RawPointer +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %26 = project_box %21 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #352. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %27 = project_box %22 : $@box Builtin.NativeObject +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %27 = project_box %22 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #353. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %28 = project_box %23 : $@box Builtin.UnknownObject +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %28 = project_box %23 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #354. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %29 = project_box %24 : $@box Builtin.Int32 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %29 = project_box %24 : $@box Builtin.Int32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #355. -// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3 -// CHECK-NEXT: %30 = project_box %25 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %13 = project_box %6 : $@box ETest_E3, 0 +// CHECK-NEXT: %30 = project_box %25 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias struct ETest_S1 { @@ -577,21 +577,21 @@ sil @enum_tests : $@convention(thin) () -> () { %5 = alloc_box $ETest_C2 %6 = alloc_box $ETest_E3 - %7 = project_box %0 : $@box ETest_S1 - %8 = project_box %1 : $@box ETest_S2 - %9 = project_box %2 : $@box ETest_E1 - %10 = project_box %3 : $@box ETest_E2 - %11 = project_box %4 : $@box ETest_C1 - %12 = project_box %5 : $@box ETest_C2 - %13 = project_box %6 : $@box ETest_E3 + %7 = project_box %0 : $@box ETest_S1, 0 + %8 = project_box %1 : $@box ETest_S2, 0 + %9 = project_box %2 : $@box ETest_E1, 0 + %10 = project_box %3 : $@box ETest_E2, 0 + %11 = project_box %4 : $@box ETest_C1, 0 + %12 = project_box %5 : $@box ETest_C2, 0 + %13 = project_box %6 : $@box ETest_E3, 0 - %14 = project_box %0 : $@box ETest_S1 - %15 = project_box %1 : $@box ETest_S2 - %16 = project_box %2 : $@box ETest_E1 - %17 = project_box %3 : $@box ETest_E2 - %18 = project_box %4 : $@box ETest_C1 - %19 = project_box %5 : $@box ETest_C2 - %20 = project_box %6 : $@box ETest_E3 + %14 = project_box %0 : $@box ETest_S1, 0 + %15 = project_box %1 : $@box ETest_S2, 0 + %16 = project_box %2 : $@box ETest_E1, 0 + %17 = project_box %3 : $@box ETest_E2, 0 + %18 = project_box %4 : $@box ETest_C1, 0 + %19 = project_box %5 : $@box ETest_C2, 0 + %20 = project_box %6 : $@box ETest_E3, 0 %21 = alloc_box $Builtin.RawPointer %22 = alloc_box $Builtin.NativeObject @@ -599,11 +599,11 @@ sil @enum_tests : $@convention(thin) () -> () { %24 = alloc_box $Builtin.Int32 %25 = alloc_box $Builtin.FPIEEE32 - %26 = project_box %21 : $@box Builtin.RawPointer - %27 = project_box %22 : $@box Builtin.NativeObject - %28 = project_box %23 : $@box Builtin.UnknownObject - %29 = project_box %24 : $@box Builtin.Int32 - %30 = project_box %25 : $@box Builtin.FPIEEE32 + %26 = project_box %21 : $@box Builtin.RawPointer, 0 + %27 = project_box %22 : $@box Builtin.NativeObject, 0 + %28 = project_box %23 : $@box Builtin.UnknownObject, 0 + %29 = project_box %24 : $@box Builtin.Int32, 0 + %30 = project_box %25 : $@box Builtin.FPIEEE32, 0 %9999 = tuple() return %9999 : $() @@ -612,130 +612,130 @@ sil @enum_tests : $@convention(thin) () -> () { // CHECK-LABEL: @class_tests // CHECK: PAIR #72. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #73. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #74. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #82. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #83. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #84. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #85. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #86. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #87. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #88. -// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1 -// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %3 = project_box %0 : $@box CTest_C1, 0 +// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #91. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #92. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #93. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #94. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #102. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #103. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #104. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #105. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #106. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #107. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #108. -// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2 -// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %4 = project_box %1 : $@box CTest_C2, 0 +// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #111. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %6 = project_box %0 : $@box CTest_C1, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #112. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %7 = project_box %1 : $@box CTest_C2, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #113. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %8 = project_box %2 : $@box CTest_C3, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #121. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %16 = project_box %9 : $@box AnyObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #122. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %17 = project_box %10 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #123. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %18 = project_box %11 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #124. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %19 = project_box %12 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #125. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %20 = project_box %13 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #126. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %21 = project_box %14 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #127. -// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3 -// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %5 = project_box %2 : $@box CTest_C3, 0 +// CHECK-NEXT: %22 = project_box %15 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias class CTest_C1 { @@ -763,13 +763,13 @@ sil @class_tests : $@convention(thin) () -> () { %1 = alloc_box $CTest_C2 %2 = alloc_box $CTest_C3 - %3 = project_box %0 : $@box CTest_C1 - %4 = project_box %1 : $@box CTest_C2 - %5 = project_box %2 : $@box CTest_C3 + %3 = project_box %0 : $@box CTest_C1, 0 + %4 = project_box %1 : $@box CTest_C2, 0 + %5 = project_box %2 : $@box CTest_C3, 0 - %6 = project_box %0 : $@box CTest_C1 - %7 = project_box %1 : $@box CTest_C2 - %8 = project_box %2 : $@box CTest_C3 + %6 = project_box %0 : $@box CTest_C1, 0 + %7 = project_box %1 : $@box CTest_C2, 0 + %8 = project_box %2 : $@box CTest_C3, 0 %9 = alloc_box $AnyObject %10 = alloc_box $Builtin.RawPointer @@ -779,13 +779,13 @@ sil @class_tests : $@convention(thin) () -> () { %14 = alloc_box $Builtin.Int32 %15 = alloc_box $Builtin.FPIEEE32 - %16 = project_box %9 : $@box AnyObject - %17 = project_box %10 : $@box Builtin.RawPointer - %18 = project_box %11 : $@box Builtin.NativeObject - %19 = project_box %12 : $@box Builtin.UnknownObject - %20 = project_box %13 : $@box Builtin.Int8 - %21 = project_box %14 : $@box Builtin.Int32 - %22 = project_box %15 : $@box Builtin.FPIEEE32 + %16 = project_box %9 : $@box AnyObject, 0 + %17 = project_box %10 : $@box Builtin.RawPointer, 0 + %18 = project_box %11 : $@box Builtin.NativeObject, 0 + %19 = project_box %12 : $@box Builtin.UnknownObject, 0 + %20 = project_box %13 : $@box Builtin.Int8, 0 + %21 = project_box %14 : $@box Builtin.Int32, 0 + %22 = project_box %15 : $@box Builtin.FPIEEE32, 0 %9999 = tuple() return %9999 : $() @@ -793,104 +793,104 @@ sil @class_tests : $@convention(thin) () -> () { // CHECK-LABEL: @tuple_tests // CHECK: PAIR #66. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %6 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %6 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #67. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64) +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #68. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64) +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #75. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #76. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #77. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #78. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8 +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #79. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32 +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #80. -// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) -// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 +// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #85. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64) +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #86. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64) +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #93. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #94. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #95. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #96. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8 +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #97. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32 +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #98. -// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) -// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 +// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #102. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64) +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #103. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64) +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #110. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %15 = project_box %9 : $@box Builtin.RawPointer, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #111. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %16 = project_box %10 : $@box Builtin.NativeObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #112. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %17 = project_box %11 : $@box Builtin.UnknownObject, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #113. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8 +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %18 = project_box %12 : $@box Builtin.Int8, 0 // CHECK-NEXT: MayAlias // CHECK: PAIR #114. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32 +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %19 = project_box %13 : $@box Builtin.Int32, 0 // CHECK-NEXT: NoAlias // CHECK: PAIR #115. -// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) -// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32 +// CHECK-NEXT: %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 +// CHECK-NEXT: %20 = project_box %14 : $@box Builtin.FPIEEE32, 0 // CHECK-NEXT: NoAlias struct TTest_S1 { @@ -907,13 +907,13 @@ sil @tuple_tests : $@convention(thin) () -> () { %1 = alloc_box $(TTest_S1, Builtin.Int64) %2 = alloc_box $(TTest_E1, Builtin.Int64) - %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) - %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64) - %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64) + %3 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 + %4 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 + %5 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 - %6 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64) - %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64) - %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64) + %6 = project_box %0 : $@box (Builtin.RawPointer, Builtin.Int64), 0 + %7 = project_box %1 : $@box (TTest_S1, Builtin.Int64), 0 + %8 = project_box %2 : $@box (TTest_E1, Builtin.Int64), 0 %9 = alloc_box $Builtin.RawPointer %10 = alloc_box $Builtin.NativeObject @@ -922,12 +922,12 @@ sil @tuple_tests : $@convention(thin) () -> () { %13 = alloc_box $Builtin.Int32 %14 = alloc_box $Builtin.FPIEEE32 - %15 = project_box %9 : $@box Builtin.RawPointer - %16 = project_box %10 : $@box Builtin.NativeObject - %17 = project_box %11 : $@box Builtin.UnknownObject - %18 = project_box %12 : $@box Builtin.Int8 - %19 = project_box %13 : $@box Builtin.Int32 - %20 = project_box %14 : $@box Builtin.FPIEEE32 + %15 = project_box %9 : $@box Builtin.RawPointer, 0 + %16 = project_box %10 : $@box Builtin.NativeObject, 0 + %17 = project_box %11 : $@box Builtin.UnknownObject, 0 + %18 = project_box %12 : $@box Builtin.Int8, 0 + %19 = project_box %13 : $@box Builtin.Int32, 0 + %20 = project_box %14 : $@box Builtin.FPIEEE32, 0 %9999 = tuple() return %9999 : $() @@ -967,13 +967,13 @@ bb0(%0 : $*Builtin.Int64): // CHECK-LABEL: @test_project_box // CHECK: PAIR #10. -// CHECK-NEXT: %2 = project_box %0 : $@box Builtin.Int32 -// CHECK-NEXT: %3 = project_box %1 : $@box Builtin.Int64 +// CHECK-NEXT: %2 = project_box %0 : $@box Builtin.Int32, 0 +// CHECK-NEXT: %3 = project_box %1 : $@box Builtin.Int64, 0 // CHECK-NEXT: NoAlias sil @test_project_box : $@convention(thin) (@box Builtin.Int32, @box Builtin.Int64) -> () { bb0(%0 : $@box Builtin.Int32, %1 : $@box Builtin.Int64): - %2 = project_box %0 : $@box Builtin.Int32 - %3 = project_box %1 : $@box Builtin.Int64 + %2 = project_box %0 : $@box Builtin.Int32, 0 + %3 = project_box %1 : $@box Builtin.Int64, 0 %r = tuple() return %r : $() diff --git a/test/Serialization/Inputs/def_basic.sil b/test/Serialization/Inputs/def_basic.sil index 5bf65abbf54..af62f9d2bb7 100644 --- a/test/Serialization/Inputs/def_basic.sil +++ b/test/Serialization/Inputs/def_basic.sil @@ -92,7 +92,7 @@ bb1: bb2: %5 = tuple () %6 = alloc_box $Int - %7 = project_box %6 : $@box Int + %7 = project_box %6 : $@box Int, 0 br bb1 } @@ -252,7 +252,7 @@ sil [fragile] @_TF4todo18erasure_from_protoFT1xPS_8RuncibleS_8Bendable__PS0__ : bb0(%0 : $*Runcible, %1 : $*Bendable & Runcible): // CHECK: alloc_box %2 = alloc_box $Bendable & Runcible - %2a = project_box %2 : $@box Bendable & Runcible + %2a = project_box %2 : $@box Bendable & Runcible, 0 // CHECK: copy_addr [take] {{.*}} to [initialization] {{.*}} : $*Bendable & Runcible %3 = copy_addr [take] %1 to [initialization] %2a : $*Bendable & Runcible // CHECK: alloc_stack @@ -277,7 +277,7 @@ protocol ClassBound : class { sil [fragile] @_TF4todo18class_bound_methodFT1xPS_10ClassBound__T_ : $@convention(thin) (@owned ClassBound) -> () { bb0(%0 : $ClassBound): %1 = alloc_box $ClassBound - %1a = project_box %1 : $@box ClassBound + %1a = project_box %1 : $@box ClassBound, 0 %2 = store %0 to %1a : $*ClassBound %3 = load %1a : $*ClassBound %4 = strong_retain %3 : $ClassBound // CHECK: strong_retain @@ -321,7 +321,7 @@ sil [fragile] @_TFV6struct5AlephCfMS0_FT_S0_ : $@convention(thin) (@thin Aleph.T bb0(%0 : $@thin Aleph.Type): %1 = tuple () %2 = alloc_box $Aleph // CHECK: alloc_box - %2a = project_box %2 : $@box Aleph + %2a = project_box %2 : $@box Aleph, 0 // CHECK: struct_element_addr {{.*}} : $*Aleph, #Aleph.a %5 = struct_element_addr %2a : $*Aleph, #Aleph.a %6 = load %5 : $*Ref @@ -389,7 +389,7 @@ sil [fragile] @_TF5tuple5tupleFT_TSiSf_ : $@convention(thin) () -> (Int, Float32 sil [fragile] @_TF5tuple13tuple_elementFT1xTSiSf__T_ : $@convention(thin) (Int, Float) -> () { bb0(%0 : $Int, %1 : $Float32): %2 = alloc_box $(Int, Float32) - %2a = project_box %2 : $@box (Int, Float32) + %2a = project_box %2 : $@box (Int, Float32), 0 %3 = tuple (%0 : $Int, %1 : $Float32) %4 = store %3 to %2a : $*(Int, Float32) // CHECK: tuple_element_addr {{%.*}} : $*(Int, Float), 0 @@ -422,10 +422,10 @@ class M { sil [fragile] @_TFC3ref1C3foofS0_FT1xSi_T_ : $@convention(method) (Int, @guaranteed M) -> () { bb0(%0 : $Int, %1 : $M): %2 = alloc_box $Int - %2a = project_box %2 : $@box Int + %2a = project_box %2 : $@box Int, 0 %3 = store %0 to %2a : $*Int %4 = alloc_box $M - %4a = project_box %4 : $@box M + %4a = project_box %4 : $@box M, 0 %5 = store %1 to %4a : $*M %6 = load %2a : $*Int %7 = load %4a : $*M @@ -447,7 +447,7 @@ class E : B { } sil [fragile] @_TF4null3isaFT1bCS_1B_Sb : $@convention(thin) (B) -> Builtin.Int1 { bb0(%0 : $B): %1 = alloc_box $B - %1a = project_box %1 : $@box B + %1a = project_box %1 : $@box B, 0 %2 = store %0 to %1a : $*B %3 = load %1a : $*B %4 = strong_retain %3 : $B @@ -473,9 +473,9 @@ sil [fragile] @_TFSS32_convertFromBuiltinStringLiteralfMSSFT5valueBp17utf8CodeUn sil [fragile] @_TF5index5gep64FT1pBp1iBi64__Bp : $@convention(thin) (Builtin.RawPointer, Builtin.Word) -> Builtin.RawPointer { bb0(%0 : $Builtin.RawPointer, %1 : $Builtin.Word): %2 = alloc_box $Builtin.RawPointer - %2a = project_box %2 : $@box Builtin.RawPointer + %2a = project_box %2 : $@box Builtin.RawPointer, 0 %3 = alloc_box $Builtin.Word - %3a = project_box %3 : $@box Builtin.Word + %3a = project_box %3 : $@box Builtin.Word, 0 %4 = store %0 to %2a : $*Builtin.RawPointer %5 = store %1 to %3a : $*Builtin.Word %7 = load %2a : $*Builtin.RawPointer @@ -514,9 +514,9 @@ class SomeSubclass : SomeClass {} sil [fragile] @test_class_metatype : $@convention(thin) (SomeClass, SomeSubclass) -> (@thick SomeClass.Type, @thick SomeClass.Type) { bb0(%0 : $SomeClass, %1 : $SomeSubclass): %2 = alloc_box $SomeClass - %2a = project_box %2 : $@box SomeClass + %2a = project_box %2 : $@box SomeClass, 0 %3 = alloc_box $SomeSubclass - %3a = project_box %3 : $@box SomeSubclass + %3a = project_box %3 : $@box SomeSubclass, 0 %4 = store %0 to %2a : $*SomeClass %5 = store %1 to %3a : $*SomeSubclass %7 = load %2a : $*SomeClass @@ -543,7 +543,7 @@ bb0(%0 : $SomeClass, %1 : $SomeSubclass): sil [fragile] @test_existential_metatype : $@convention(thin) (@in SomeProtocol) -> @thick SomeProtocol.Type { bb0(%0 : $*SomeProtocol): %1 = alloc_box $SomeProtocol - %1a = project_box %1 : $@box SomeProtocol + %1a = project_box %1 : $@box SomeProtocol, 0 // CHECK: copy_addr [take] %0 to [initialization] %{{.*}} : $*SomeProtocol %2 = copy_addr [take] %0 to [initialization] %1a : $*SomeProtocol // CHECK: alloc_stack @@ -615,9 +615,9 @@ bb3(%4 : $Int): sil [fragile] @test_builtin_func_ref : $@convention(thin) (Builtin.Int1, Builtin.Int1) -> Builtin.Int1 { bb0(%0 : $Builtin.Int1, %1 : $Builtin.Int1): %2 = alloc_box $Builtin.Int1 - %2a = project_box %2 : $@box Builtin.Int1 + %2a = project_box %2 : $@box Builtin.Int1, 0 %3 = alloc_box $Builtin.Int1 - %3a = project_box %3 : $@box Builtin.Int1 + %3a = project_box %3 : $@box Builtin.Int1, 0 store %0 to %2a : $*Builtin.Int1 store %1 to %3a : $*Builtin.Int1 %8 = load %2a : $*Builtin.Int1 @@ -707,7 +707,7 @@ sil [fragile] @closure0 : $@convention(thin) (@box Int, @inout Int) -> () sil [fragile] @closure_test : $@convention(thin) () -> () { bb0: %0 = alloc_box $Int // users: %10, %8, %8, %7, %4 - %0a = project_box %0 : $@box Int + %0a = project_box %0 : $@box Int, 0 %5 = function_ref @takes_closure : $@convention(thin) (@callee_owned () -> ()) -> () %6 = function_ref @closure0 : $@convention(thin) (@box Int, @inout Int) -> () @@ -735,7 +735,7 @@ sil [fragile] @_TF6switch1cFT_T_ : $@convention(thin) () -> () sil [fragile] @test_switch_union : $@convention(thin) (MaybePair) -> () { bb0(%0 : $MaybePair): %1 = alloc_box $MaybePair - %1a = project_box %1 : $@box MaybePair + %1a = project_box %1 : $@box MaybePair, 0 store %0 to %1a : $*MaybePair %3 = load %1a : $*MaybePair %4 = tuple () @@ -825,7 +825,7 @@ struct Spoon : Bendable { sil [fragile] @test_init_existential : $@convention(thin) (Spoon) -> @out Bendable { bb0(%0 : $*Bendable, %1 : $Spoon): %2 = alloc_box $Spoon - %2a = project_box %2 : $@box Spoon + %2a = project_box %2 : $@box Spoon, 0 store %1 to %2a : $*Spoon // CHECK: init_existential_addr %{{.*}} : $*Bendable, $Spoon %4 = init_existential_addr %0 : $*Bendable, $Spoon @@ -842,7 +842,7 @@ bb0(%0 : $*Bendable, %1 : $Spoon): sil [fragile] @test_existential_ref : $@convention(thin) (ConcreteClass) -> ClassP { bb0(%0 : $ConcreteClass): %1 = alloc_box $ConcreteClass - %1a = project_box %1 : $@box ConcreteClass + %1a = project_box %1 : $@box ConcreteClass, 0 store %0 to %1a : $*ConcreteClass %3 = load %1a : $*ConcreteClass strong_retain %3 : $ConcreteClass @@ -924,7 +924,7 @@ class X { sil [fragile] @test_dynamic_lookup_br : $@convention(thin) (AnyObject) -> () { bb0(%0 : $AnyObject): %1 = alloc_box $AnyObject - %1a = project_box %1 : $@box AnyObject + %1a = project_box %1 : $@box AnyObject, 0 store %0 to %1a : $*AnyObject %3 = alloc_box $Optional<() -> ()> %4 = load %1a : $*AnyObject @@ -948,9 +948,9 @@ bb3: // CHECK-LABEL: sil public_external [fragile] @test_mark_fn_escape sil [fragile] @test_mark_fn_escape : $@convention(thin) () -> () { %b = alloc_box $Int - %ba = project_box %b : $@box Int + %ba = project_box %b : $@box Int, 0 %c = alloc_box $Int - %ca = project_box %c : $@box Int + %ca = project_box %c : $@box Int, 0 //mark_function_escape %ba : $*Int //mark_function_escape %ba : $*Int, %ca : $*Int @@ -1085,8 +1085,8 @@ sil [fragile] @box_type : $@convention(thin) (@box Int, Int) -> () { bb0(%0 : $@box Int, %1 : $Int): // CHECK-NEXT: strong_retain %0 : $@box Int strong_retain %0 : $@box Int - // CHECK-NEXT: %3 = project_box %0 : $@box Int - %3 = project_box %0 : $@box Int + // CHECK-NEXT: %3 = project_box %0 : $@box Int, 0 + %3 = project_box %0 : $@box Int, 0 // CHECK-NEXT: store %1 to %3 : $*Int store %1 to %3 : $*Int // CHECK-NEXT: strong_release %0 : $@box Int diff --git a/test/sil-extract/basic.sil b/test/sil-extract/basic.sil index 91b9aac3b1c..2bc01605efa 100644 --- a/test/sil-extract/basic.sil +++ b/test/sil-extract/basic.sil @@ -18,7 +18,7 @@ sil @makesInt : $@convention(thin) () -> Int64 sil @use_before_init : $@convention(thin) () -> Int64 { bb0: %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 %2 = load %1a : $*Int64 %3 = function_ref @inout_uninit : $@convention(thin)() -> () apply %3() : $@convention(thin) () -> () @@ -30,7 +30,7 @@ bb0: sil @inout_uninit : $@convention(thin) () -> () { bb0: %1 = alloc_box $Int64 - %1a = project_box %1 : $@box Int64 + %1a = project_box %1 : $@box Int64, 0 %5 = function_ref @takes_Int_inout : $@convention(thin) (@inout Int64) -> () %6 = apply %5(%1a) : $@convention(thin) (@inout Int64) -> ()