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-any-value-marshalling.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source/slang/slang-ir-any-value-marshalling.cpp') diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index 13059a84a..f09294aa9 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -145,13 +145,10 @@ namespace Slang case kIROp_VectorType: { auto vectorType = static_cast(dataType); - auto elementType = vectorType->getElementType(); auto elementCount = getIntVal(vectorType->getElementCount()); - auto elementPtrType = builder->getPtrType(elementType); for (IRIntegerValue i = 0; i < elementCount; i++) { auto elementAddr = builder->emitElementAddress( - elementPtrType, concreteTypedVar, builder->getIntValue(builder->getIntType(), i)); emitMarshallingCode(builder, context, elementAddr); @@ -161,20 +158,16 @@ namespace Slang case kIROp_MatrixType: { auto matrixType = static_cast(dataType); - auto elementType = matrixType->getElementType(); auto colCount = getIntVal(matrixType->getColumnCount()); auto rowCount = getIntVal(matrixType->getRowCount()); - auto rowVecType = builder->getVectorType(elementType, matrixType->getRowCount()); for (IRIntegerValue i = 0; i < colCount; i++) { auto col = builder->emitElementAddress( - builder->getPtrType(rowVecType), concreteTypedVar, builder->getIntValue(builder->getIntType(), i)); for (IRIntegerValue j = 0; j < rowCount; j++) { auto element = builder->emitElementAddress( - builder->getPtrType(elementType), col, builder->getIntValue(builder->getIntType(), j)); emitMarshallingCode(builder, context, element); @@ -198,11 +191,9 @@ namespace Slang case kIROp_ArrayType: { auto arrayType = cast(dataType); - auto elementPtrType = builder->getPtrType(arrayType->getElementType()); for (IRIntegerValue i = 0; i < getIntVal(arrayType->getElementCount()); i++) { auto fieldAddr = builder->emitElementAddress( - elementPtrType, concreteTypedVar, builder->getIntValue(builder->getIntType(), i)); emitMarshallingCode(builder, context, fieldAddr); -- cgit v1.2.3