From c9d89a40775a055873adf82cfb0ee1cb6bdcb93c Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 25 Jul 2024 15:00:14 -0700 Subject: Overhaul IR lowering of pointer types. (#4710) * Overhaul IR lowering of pointer types. * Propagate address space in IRBuilder. * Fixup. * Fix. * Fix. * Change how Ptr type is printed to text. * Fix. --- source/slang/slang-ir-specialize.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/slang/slang-ir-specialize.cpp') diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index 5713b9639..5c9e1ad24 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -1996,9 +1996,6 @@ struct SpecializationContext auto index = inst->getIndex(); auto val = wrapInst->getWrappedValue(); - auto ptrType = cast(val->getDataType()); - auto arrayType = cast(ptrType->getValueType()); - auto elementType = arrayType->getElementType(); auto resultType = inst->getFullType(); @@ -2013,8 +2010,7 @@ struct SpecializationContext slotOperands.add(wrapInst->getSlotOperand(ii)); } - auto elementPtrType = builder.getPtrType(ptrType->getOp(), elementType); - auto newElementAddr = builder.emitElementAddress(elementPtrType, val, index); + auto newElementAddr = builder.emitElementAddress(val, index); auto newWrapExistentialInst = builder.emitWrapExistential( resultType, newElementAddr, slotOperandCount, slotOperands.getArrayView().getBuffer()); -- cgit v1.2.3