[flang-commits] [flang] [mlir] [mlir][MemorySlotInterfaces] Rename `elemType` to `valueType` (NFC) (PR #228466)
Andrzej WarzyĆski via flang-commits
flang-commits at lists.llvm.org
Mon Oct 5 01:25:53 PDT 2026
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/228466
>From 499e0e8107a2f8f21d741748de34363eb71a8fb8 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Fri, 2 Oct 2026 15:41:57 +0100
Subject: [PATCH] [mlir][MemorySlotInterfaces] Rename `elemType` to `valueType`
(NFC)
The name `elemType` is potentially confusing, as "element type" already has
a well-defined meaning for types such as MemRef and Vector.
As of #211880, `MemorySlotInterfaces` also supports vector ops, and the type
represented by `elemType` can itself be a Vector type. In that case, the
Vector is the value stored in the memory slot, while its element type is a
different type.
This PR renames `elemType` to `valueType` to make this distinction explicit.
---
flang/lib/Optimizer/Dialect/FIROps.cpp | 2 +-
.../mlir/Interfaces/MemorySlotInterfaces.h | 2 +-
mlir/lib/Dialect/Affine/IR/MemorySlot.cpp | 4 +-
mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp | 48 ++++++++++---------
.../Dialect/MemRef/IR/MemRefMemorySlot.cpp | 6 +--
mlir/lib/Dialect/SCF/IR/MemorySlot.cpp | 16 +++----
.../Transforms/MemorySlotOpInterfaceImpl.cpp | 6 +--
mlir/lib/Transforms/Mem2Reg.cpp | 2 +-
mlir/lib/Transforms/SROA.cpp | 2 +-
mlir/test/lib/Dialect/Test/TestOpDefs.cpp | 22 ++++-----
10 files changed, 57 insertions(+), 53 deletions(-)
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 2480996cb411c03..e89cccaea66d0f7 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -297,7 +297,7 @@ llvm::SmallVector<mlir::MemorySlot> fir::AllocaOp::getPromotableSlots() {
mlir::Value fir::AllocaOp::getDefaultValue(const mlir::MemorySlot &slot,
mlir::OpBuilder &builder) {
- return fir::UndefOp::create(builder, getLoc(), slot.elemType);
+ return fir::UndefOp::create(builder, getLoc(), slot.valueType);
}
void fir::AllocaOp::handleBlockArgument(const mlir::MemorySlot &slot,
diff --git a/mlir/include/mlir/Interfaces/MemorySlotInterfaces.h b/mlir/include/mlir/Interfaces/MemorySlotInterfaces.h
index 4ddacd67f99c258..b2b5418e1bac101 100644
--- a/mlir/include/mlir/Interfaces/MemorySlotInterfaces.h
+++ b/mlir/include/mlir/Interfaces/MemorySlotInterfaces.h
@@ -23,7 +23,7 @@ struct MemorySlot {
/// Pointer to the memory slot, used by operations to refer to it.
Value ptr;
/// Type of the value contained in the slot.
- Type elemType;
+ Type valueType;
};
/// Memory slot attached with information about its destructuring procedure.
diff --git a/mlir/lib/Dialect/Affine/IR/MemorySlot.cpp b/mlir/lib/Dialect/Affine/IR/MemorySlot.cpp
index 7b74b7eb7bb6b60..9d1452a7de6e839 100644
--- a/mlir/lib/Dialect/Affine/IR/MemorySlot.cpp
+++ b/mlir/lib/Dialect/Affine/IR/MemorySlot.cpp
@@ -31,7 +31,7 @@ void AffineForOp::setupPromotion(
}
getInitsMutable().append(reachingDef);
- bodyRegion.addArgument(slot.elemType, slot.ptr.getLoc());
+ bodyRegion.addArgument(slot.valueType, slot.ptr.getLoc());
regionsToProcess.insert({&bodyRegion, bodyRegion.getArguments().back()});
}
@@ -47,7 +47,7 @@ Value AffineForOp::finalizePromotion(
memoryslot::updateTerminator(getBody(), reachingDef, reachingAtBlockEnd);
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
IRRewriter rewriter(builder);
Operation *newOp =
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
index b398556d5328caa..b76dc8647b91b0d 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
@@ -38,7 +38,7 @@ llvm::SmallVector<MemorySlot> LLVM::AllocaOp::getPromotableSlots() {
Value LLVM::AllocaOp::getDefaultValue(const MemorySlot &slot,
OpBuilder &builder) {
- return LLVM::UndefOp::create(builder, getLoc(), slot.elemType);
+ return LLVM::UndefOp::create(builder, getLoc(), slot.valueType);
}
void LLVM::AllocaOp::handleBlockArgument(const MemorySlot &slot,
@@ -358,7 +358,7 @@ static Value createInsertAndCast(OpBuilder &builder, Location loc,
Value LLVM::StoreOp::getStored(const MemorySlot &slot, OpBuilder &builder,
Value reachingDef,
const DataLayout &dataLayout) {
- assert(reachingDef && reachingDef.getType() == slot.elemType &&
+ assert(reachingDef && reachingDef.getType() == slot.valueType &&
"expected the reaching definition's type to match the slot's type");
return createInsertAndCast(builder, getLoc(), getValue(), reachingDef,
dataLayout);
@@ -376,7 +376,8 @@ bool LLVM::LoadOp::canUsesBeRemoved(
// be removed (provided it is not volatile).
return blockingUse == slot.ptr && getAddr() == slot.ptr &&
areConversionCompatible(dataLayout, getResult().getType(),
- slot.elemType, /*narrowingConversion=*/true) &&
+ slot.valueType,
+ /*narrowingConversion=*/true) &&
!getVolatile_();
}
@@ -404,7 +405,7 @@ bool LLVM::StoreOp::canUsesBeRemoved(
// store OF the slot pointer, only INTO the slot pointer.
return blockingUse == slot.ptr && getAddr() == slot.ptr &&
getValue() != slot.ptr &&
- areConversionCompatible(dataLayout, slot.elemType,
+ areConversionCompatible(dataLayout, slot.valueType,
getValue().getType(),
/*narrowingConversion=*/false) &&
!getVolatile_();
@@ -421,7 +422,7 @@ DeletionKind LLVM::StoreOp::removeBlockingUses(
static bool isValidAccessType(const MemorySlot &slot, Type accessType,
const DataLayout &dataLayout) {
return dataLayout.getTypeSize(accessType) <=
- dataLayout.getTypeSize(slot.elemType);
+ dataLayout.getTypeSize(slot.valueType);
}
LogicalResult LLVM::LoadOp::ensureOnlySafeAccesses(
@@ -442,7 +443,7 @@ LogicalResult LLVM::StoreOp::ensureOnlySafeAccesses(
static Type getTypeAtIndex(const DestructurableMemorySlot &slot,
Attribute index) {
auto subelementIndexMap =
- cast<DestructurableTypeInterface>(slot.elemType).getSubelementIndexMap();
+ cast<DestructurableTypeInterface>(slot.valueType).getSubelementIndexMap();
if (!subelementIndexMap)
return {};
assert(!subelementIndexMap->empty());
@@ -783,7 +784,7 @@ getSubslotAccessInfo(const DestructurableMemorySlot &slot,
return index >= (1 << LLVM::kGEPConstantBitWidth);
};
- Type type = slot.elemType;
+ Type type = slot.valueType;
if (*offset >= dataLayout.getTypeSize(type))
return {};
return TypeSwitch<Type, std::optional<SubslotAccessInfo>>(type)
@@ -845,7 +846,7 @@ LogicalResult LLVM::GEPOp::ensureOnlySafeAccesses(
std::optional<uint64_t> gepOffset = gepToByteOffset(dataLayout, *this);
if (!gepOffset)
return failure();
- uint64_t slotSize = dataLayout.getTypeSize(slot.elemType);
+ uint64_t slotSize = dataLayout.getTypeSize(slot.valueType);
// Check that the access is strictly inside the slot.
if (*gepOffset >= slotSize)
return failure();
@@ -1019,7 +1020,7 @@ static bool definitelyWritesOnlyWithinSlot(MemIntr op, const MemorySlot &slot,
return false;
std::optional<uint64_t> memIntrLen = getStaticMemIntrLen(op);
- return memIntrLen && *memIntrLen <= dataLayout.getTypeSize(slot.elemType);
+ return memIntrLen && *memIntrLen <= dataLayout.getTypeSize(slot.valueType);
}
/// Checks whether all indices are i32. This is used to check GEPs can index
@@ -1042,13 +1043,14 @@ static bool memsetCanRewire(MemsetIntr op, const DestructurableMemorySlot &slot,
SmallPtrSetImpl<Attribute> &usedIndices,
SmallVectorImpl<MemorySlot> &mustBeSafelyUsed,
const DataLayout &dataLayout) {
- if (&slot.elemType.getDialect() != op.getOperation()->getDialect())
+ if (&slot.valueType.getDialect() != op.getOperation()->getDialect())
return false;
if (op.getIsVolatile())
return false;
- if (!cast<DestructurableTypeInterface>(slot.elemType).getSubelementIndexMap())
+ if (!cast<DestructurableTypeInterface>(slot.valueType)
+ .getSubelementIndexMap())
return false;
if (!areAllIndicesI32(slot))
@@ -1099,7 +1101,7 @@ static Value memsetGetStored(MemsetIntr op, const MemorySlot &slot,
return currentValue;
};
- return TypeSwitch<Type, Value>(slot.elemType)
+ return TypeSwitch<Type, Value>(slot.valueType)
.Case([&](IntegerType type) -> Value {
return buildMemsetValue(type.getWidth());
})
@@ -1118,7 +1120,7 @@ memsetCanUsesBeRemoved(MemsetIntr op, const MemorySlot &slot,
SmallVectorImpl<OpOperand *> &newBlockingUses,
const DataLayout &dataLayout) {
bool canConvertType =
- TypeSwitch<Type, bool>(slot.elemType)
+ TypeSwitch<Type, bool>(slot.valueType)
.Case<IntegerType, FloatType>([](auto type) {
return type.getWidth() % 8 == 0 && type.getWidth() > 0;
})
@@ -1129,7 +1131,7 @@ memsetCanUsesBeRemoved(MemsetIntr op, const MemorySlot &slot,
if (op.getIsVolatile())
return false;
- return getStaticMemIntrLen(op) == dataLayout.getTypeSize(slot.elemType);
+ return getStaticMemIntrLen(op) == dataLayout.getTypeSize(slot.valueType);
}
template <class MemsetIntr>
@@ -1139,12 +1141,12 @@ memsetRewire(MemsetIntr op, const DestructurableMemorySlot &slot,
const DataLayout &dataLayout) {
std::optional<DenseMap<Attribute, Type>> types =
- cast<DestructurableTypeInterface>(slot.elemType).getSubelementIndexMap();
+ cast<DestructurableTypeInterface>(slot.valueType).getSubelementIndexMap();
IntegerAttr memsetLenAttr = createMemsetLenAttr(op);
bool packed = false;
- if (auto structType = dyn_cast<LLVM::LLVMStructType>(slot.elemType))
+ if (auto structType = dyn_cast<LLVM::LLVMStructType>(slot.valueType))
packed = structType.isPacked();
Type i32 = IntegerType::get(op.getContext(), 32);
@@ -1291,7 +1293,8 @@ static bool memcpyStoresTo(MemcpyLike op, const MemorySlot &slot) {
template <class MemcpyLike>
static Value memcpyGetStored(MemcpyLike op, const MemorySlot &slot,
OpBuilder &builder) {
- return LLVM::LoadOp::create(builder, op.getLoc(), slot.elemType, op.getSrc());
+ return LLVM::LoadOp::create(builder, op.getLoc(), slot.valueType,
+ op.getSrc());
}
template <class MemcpyLike>
@@ -1309,7 +1312,7 @@ memcpyCanUsesBeRemoved(MemcpyLike op, const MemorySlot &slot,
if (op.getIsVolatile())
return false;
- return getStaticMemIntrLen(op) == dataLayout.getTypeSize(slot.elemType);
+ return getStaticMemIntrLen(op) == dataLayout.getTypeSize(slot.valueType);
}
template <class MemcpyLike>
@@ -1342,14 +1345,15 @@ static bool memcpyCanRewire(MemcpyLike op, const DestructurableMemorySlot &slot,
if (op.getIsVolatile())
return false;
- if (!cast<DestructurableTypeInterface>(slot.elemType).getSubelementIndexMap())
+ if (!cast<DestructurableTypeInterface>(slot.valueType)
+ .getSubelementIndexMap())
return false;
if (!areAllIndicesI32(slot))
return false;
// Only full copies are supported.
- if (getStaticMemIntrLen(op) != dataLayout.getTypeSize(slot.elemType))
+ if (getStaticMemIntrLen(op) != dataLayout.getTypeSize(slot.valueType))
return false;
if (op.getSrc() == slot.ptr)
@@ -1422,13 +1426,13 @@ memcpyRewire(MemcpyLike op, const DestructurableMemorySlot &slot,
cast<IntegerAttr>(index).getValue().getZExtValue())};
Value subslotPtrInOther = LLVM::GEPOp::create(
builder, op.getLoc(), LLVM::LLVMPointerType::get(op.getContext()),
- slot.elemType, isDst ? op.getSrc() : op.getDst(), gepIndices);
+ slot.valueType, isDst ? op.getSrc() : op.getDst(), gepIndices);
// Then create a new memcpy out of this source pointer.
createMemcpyLikeToReplace(builder, dataLayout, op,
isDst ? subslot.ptr : subslotPtrInOther,
isDst ? subslotPtrInOther : subslot.ptr,
- subslot.elemType, op.getIsVolatile());
+ subslot.valueType, op.getIsVolatile());
}
assert(subslots.size() == slotsTreated);
diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
index 0b1704b551fdd53..7f58e099b45b51d 100644
--- a/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
+++ b/mlir/lib/Dialect/MemRef/IR/MemRefMemorySlot.cpp
@@ -137,7 +137,7 @@ SmallVector<MemorySlot> memref::AllocaOp::getPromotableSlots() {
Value memref::AllocaOp::getDefaultValue(const MemorySlot &slot,
OpBuilder &builder) {
- return ub::PoisonOp::create(builder, getLoc(), slot.elemType);
+ return ub::PoisonOp::create(builder, getLoc(), slot.valueType);
}
std::optional<PromotableAllocationOpInterface>
@@ -223,7 +223,7 @@ bool memref::LoadOp::canUsesBeRemoved(
return false;
Value blockingUse = (*blockingUses.begin())->get();
return blockingUse == slot.ptr && getMemRef() == slot.ptr &&
- getResult().getType() == slot.elemType;
+ getResult().getType() == slot.valueType;
}
DeletionKind memref::LoadOp::removeBlockingUses(
@@ -303,7 +303,7 @@ bool memref::StoreOp::canUsesBeRemoved(
return false;
Value blockingUse = (*blockingUses.begin())->get();
return blockingUse == slot.ptr && getMemRef() == slot.ptr &&
- getValue() != slot.ptr && getValue().getType() == slot.elemType;
+ getValue() != slot.ptr && getValue().getType() == slot.valueType;
}
DeletionKind memref::StoreOp::removeBlockingUses(
diff --git a/mlir/lib/Dialect/SCF/IR/MemorySlot.cpp b/mlir/lib/Dialect/SCF/IR/MemorySlot.cpp
index 92fc3452d4629b6..6ec36b5bebbb6f4 100644
--- a/mlir/lib/Dialect/SCF/IR/MemorySlot.cpp
+++ b/mlir/lib/Dialect/SCF/IR/MemorySlot.cpp
@@ -41,7 +41,7 @@ Value ExecuteRegionOp::finalizePromotion(
memoryslot::updateTerminator(&block, reachingDef, reachingAtBlockEnd);
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
IRRewriter rewriter(builder);
Operation *newOp =
@@ -68,7 +68,7 @@ void ForOp::setupPromotion(
}
getInitArgsMutable().append(reachingDef);
- bodyRegion.addArgument(slot.elemType, slot.ptr.getLoc());
+ bodyRegion.addArgument(slot.valueType, slot.ptr.getLoc());
regionsToProcess.insert({&bodyRegion, bodyRegion.getArguments().back()});
}
@@ -84,7 +84,7 @@ Value ForOp::finalizePromotion(
memoryslot::updateTerminator(getBody(), reachingDef, reachingAtBlockEnd);
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
IRRewriter rewriter(builder);
Operation *newOp =
@@ -157,7 +157,7 @@ Value IfOp::finalizePromotion(
}
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
Operation *newOp =
memoryslot::replaceWithNewResults(rewriter, getOperation(), resultTypes);
@@ -199,7 +199,7 @@ Value IndexSwitchOp::finalizePromotion(
reachingAtBlockEnd);
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
Operation *newOp =
memoryslot::replaceWithNewResults(rewriter, getOperation(), resultTypes);
@@ -281,10 +281,10 @@ void WhileOp::setupPromotion(
getInitsMutable().append(reachingDef);
- beforeRegion.addArgument(slot.elemType, slot.ptr.getLoc());
+ beforeRegion.addArgument(slot.valueType, slot.ptr.getLoc());
regionsToProcess.insert({&beforeRegion, beforeRegion.getArguments().back()});
- afterRegion.addArgument(slot.elemType, slot.ptr.getLoc());
+ afterRegion.addArgument(slot.valueType, slot.ptr.getLoc());
regionsToProcess.insert({&afterRegion, afterRegion.getArguments().back()});
}
@@ -304,7 +304,7 @@ Value WhileOp::finalizePromotion(
&getAfter().back(), getAfter().getArguments().back(), reachingAtBlockEnd);
SmallVector<Type> resultTypes(getResultTypes());
- resultTypes.push_back(slot.elemType);
+ resultTypes.push_back(slot.valueType);
IRRewriter rewriter(builder);
Operation *newOp =
diff --git a/mlir/lib/Dialect/Vector/Transforms/MemorySlotOpInterfaceImpl.cpp b/mlir/lib/Dialect/Vector/Transforms/MemorySlotOpInterfaceImpl.cpp
index 1acebcb21543906..f33b746240d8e64 100644
--- a/mlir/lib/Dialect/Vector/Transforms/MemorySlotOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/MemorySlotOpInterfaceImpl.cpp
@@ -62,7 +62,7 @@ isWholeBufferTransfer(VectorTransferOpInterface xferOp, const MemorySlot &slot,
return false;
// Exact type match pins rank/extents/element type/scalable dims.
- if (xferOp.getVectorType() != slot.elemType)
+ if (xferOp.getVectorType() != slot.valueType)
return false;
// Access must start at the buffer origin in every dimension.
@@ -235,7 +235,7 @@ struct SubViewOpAliasModel
// The parent slot must promote to a vector (whole-buffer promotion). A
// scalar (single-element) parent slot cannot be sliced.
- auto parentVecType = dyn_cast<VectorType>(parentSlot.elemType);
+ auto parentVecType = dyn_cast<VectorType>(parentSlot.valueType);
if (!parentVecType)
return;
@@ -259,7 +259,7 @@ struct SubViewOpAliasModel
OpBuilder &builder) const {
auto subView = cast<memref::SubViewOp>(op);
SmallVector<int64_t> offsets = *getPromotableSubViewOffsets(subView);
- auto aliasVecType = cast<VectorType>(aliasSlot.elemType);
+ auto aliasVecType = cast<VectorType>(aliasSlot.valueType);
SmallVector<int64_t> strides(offsets.size(), 1);
return vector::ExtractStridedSliceOp::create(
builder, op->getLoc(), slotValue, offsets,
diff --git a/mlir/lib/Transforms/Mem2Reg.cpp b/mlir/lib/Transforms/Mem2Reg.cpp
index 12f50d777e79c8c..f2c9e47deb3d2f4 100644
--- a/mlir/lib/Transforms/Mem2Reg.cpp
+++ b/mlir/lib/Transforms/Mem2Reg.cpp
@@ -720,7 +720,7 @@ void MemorySlotPromoter::promoteInRegion(Region *region, Value reachingDef) {
if (info.mergePoints.contains(block)) {
BlockArgument blockArgument =
- block->addArgument(slot.elemType, slot.ptr.getLoc());
+ block->addArgument(slot.valueType, slot.ptr.getLoc());
job.reachingDef = blockArgument;
}
diff --git a/mlir/lib/Transforms/SROA.cpp b/mlir/lib/Transforms/SROA.cpp
index 859c0302185e69e..fb26a9264bf3a10 100644
--- a/mlir/lib/Transforms/SROA.cpp
+++ b/mlir/lib/Transforms/SROA.cpp
@@ -47,7 +47,7 @@ struct MemorySlotDestructuringInfo {
static std::optional<MemorySlotDestructuringInfo>
computeDestructuringInfo(DestructurableMemorySlot &slot,
const DataLayout &dataLayout) {
- assert(isa<DestructurableTypeInterface>(slot.elemType));
+ assert(isa<DestructurableTypeInterface>(slot.valueType));
if (slot.ptr.use_empty())
return {};
diff --git a/mlir/test/lib/Dialect/Test/TestOpDefs.cpp b/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
index 9fe2168e1173744..ad08c5c6501b7f0 100644
--- a/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
+++ b/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
@@ -1836,7 +1836,7 @@ llvm::SmallVector<MemorySlot> TestMultiSlotAlloca::getPromotableSlots() {
Value TestMultiSlotAlloca::getDefaultValue(const MemorySlot &slot,
OpBuilder &builder) {
- return TestOpConstant::create(builder, getLoc(), slot.elemType,
+ return TestOpConstant::create(builder, getLoc(), slot.valueType,
builder.getI32IntegerAttr(42));
}
@@ -1991,10 +1991,10 @@ Value TestTransparentCastAlias::projectSlotValueToAliasValue(
OpOperand & /*aliasedSlotPointerOperand*/,
const MemorySlot & /*parentSlot*/, const MemorySlot &aliasSlot,
Value slotValue, OpBuilder &builder) {
- if (slotValue.getType() == aliasSlot.elemType)
+ if (slotValue.getType() == aliasSlot.valueType)
return slotValue;
return UnrealizedConversionCastOp::create(builder, getLoc(),
- aliasSlot.elemType, slotValue)
+ aliasSlot.valueType, slotValue)
.getResult(0);
}
@@ -2002,10 +2002,10 @@ Value TestTransparentCastAlias::projectAliasValueToSlotValue(
OpOperand & /*aliasedSlotPointerOperand*/, const MemorySlot &parentSlot,
const MemorySlot & /*aliasSlot*/, Value aliasValue, Value /*reachingDef*/,
OpBuilder &builder) {
- if (aliasValue.getType() == parentSlot.elemType)
+ if (aliasValue.getType() == parentSlot.valueType)
return aliasValue;
return UnrealizedConversionCastOp::create(builder, getLoc(),
- parentSlot.elemType, aliasValue)
+ parentSlot.valueType, aliasValue)
.getResult(0);
}
@@ -2047,10 +2047,10 @@ Value TestTransparentDualAlias::projectSlotValueToAliasValue(
OpOperand & /*aliasedSlotPointerOperand*/,
const MemorySlot & /*parentSlot*/, const MemorySlot &aliasSlot,
Value slotValue, OpBuilder &builder) {
- if (slotValue.getType() == aliasSlot.elemType)
+ if (slotValue.getType() == aliasSlot.valueType)
return slotValue;
return UnrealizedConversionCastOp::create(builder, getLoc(),
- aliasSlot.elemType, slotValue)
+ aliasSlot.valueType, slotValue)
.getResult(0);
}
@@ -2058,10 +2058,10 @@ Value TestTransparentDualAlias::projectAliasValueToSlotValue(
OpOperand & /*aliasedSlotPointerOperand*/, const MemorySlot &parentSlot,
const MemorySlot & /*aliasSlot*/, Value aliasValue, Value /*reachingDef*/,
OpBuilder &builder) {
- if (aliasValue.getType() == parentSlot.elemType)
+ if (aliasValue.getType() == parentSlot.valueType)
return aliasValue;
return UnrealizedConversionCastOp::create(builder, getLoc(),
- parentSlot.elemType, aliasValue)
+ parentSlot.valueType, aliasValue)
.getResult(0);
}
@@ -2098,7 +2098,7 @@ Value TestPartialAlias::projectSlotValueToAliasValue(
Value slotValue, OpBuilder &builder) {
// Sub-value extraction: 1-input cast.
return UnrealizedConversionCastOp::create(builder, getLoc(),
- aliasSlot.elemType, slotValue)
+ aliasSlot.valueType, slotValue)
.getResult(0);
}
@@ -2109,7 +2109,7 @@ Value TestPartialAlias::projectAliasValueToSlotValue(
// Sub-value insertion into the current reaching definition: emit a 2-input
// cast taking both the new alias value and the existing parent value.
return UnrealizedConversionCastOp::create(builder, getLoc(),
- parentSlot.elemType,
+ parentSlot.valueType,
ValueRange{aliasValue, reachingDef})
.getResult(0);
}
More information about the flang-commits
mailing list