@@ -1431,8 +1431,8 @@ struct EmboxCommonConversion : public fir::FIROpConversion<OP> {
1431
1431
fir::unwrapPassByRefType (memref.getType ()))))
1432
1432
TODO (xbox.getLoc (),
1433
1433
" fir.embox codegen dynamic size component in derived type" );
1434
- indices.append (operands.begin () + xbox.subcomponentOffset (),
1435
- operands.begin () + xbox.subcomponentOffset () +
1434
+ indices.append (operands.begin () + xbox.getSubcomponentOperandIndex (),
1435
+ operands.begin () + xbox.getSubcomponentOperandIndex () +
1436
1436
xbox.getSubcomponent ().size ());
1437
1437
}
1438
1438
@@ -1487,7 +1487,7 @@ struct EmboxOpConversion : public EmboxCommonConversion<fir::EmboxOp> {
1487
1487
mlir::Value sourceBox;
1488
1488
mlir::Type sourceBoxType;
1489
1489
if (embox.getSourceBox ()) {
1490
- sourceBox = operands[embox.getSourceBoxOffset ()];
1490
+ sourceBox = operands[embox.getSourceBoxOperandIndex ()];
1491
1491
sourceBoxType = embox.getSourceBox ().getType ();
1492
1492
}
1493
1493
assert (!embox.getShape () && " There should be no dims on this embox op" );
@@ -1519,7 +1519,7 @@ struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
1519
1519
mlir::Value sourceBox;
1520
1520
mlir::Type sourceBoxType;
1521
1521
if (xbox.getSourceBox ()) {
1522
- sourceBox = operands[xbox.getSourceBoxOffset ()];
1522
+ sourceBox = operands[xbox.getSourceBoxOperandIndex ()];
1523
1523
sourceBoxType = xbox.getSourceBox ().getType ();
1524
1524
}
1525
1525
auto [boxTy, dest, resultEleSize] = consDescriptorPrefix (
@@ -1529,11 +1529,11 @@ struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
1529
1529
// Generate the triples in the dims field of the descriptor
1530
1530
auto i64Ty = mlir::IntegerType::get (xbox.getContext (), 64 );
1531
1531
assert (!xbox.getShape ().empty () && " must have a shape" );
1532
- unsigned shapeOffset = xbox.shapeOffset ();
1532
+ unsigned shapeOffset = xbox.getShapeOperandIndex ();
1533
1533
bool hasShift = !xbox.getShift ().empty ();
1534
- unsigned shiftOffset = xbox.shiftOffset ();
1534
+ unsigned shiftOffset = xbox.getShiftOperandIndex ();
1535
1535
bool hasSlice = !xbox.getSlice ().empty ();
1536
- unsigned sliceOffset = xbox.sliceOffset ();
1536
+ unsigned sliceOffset = xbox.getSliceOperandIndex ();
1537
1537
mlir::Location loc = xbox.getLoc ();
1538
1538
mlir::Value zero = genConstantIndex (loc, i64Ty, rewriter, 0 );
1539
1539
mlir::Value one = genConstantIndex (loc, i64Ty, rewriter, 1 );
@@ -1682,7 +1682,7 @@ struct XEmboxOpConversion : public EmboxCommonConversion<fir::cg::XEmboxOp> {
1682
1682
if (hasSubcomp)
1683
1683
getSubcomponentIndices (xbox, xbox.getMemref (), operands, fieldIndices);
1684
1684
if (hasSubstr)
1685
- substringOffset = operands[xbox.substrOffset ()];
1685
+ substringOffset = operands[xbox.getSubstrOperandIndex ()];
1686
1686
mlir::Type llvmBaseType =
1687
1687
convertType (fir::unwrapRefType (xbox.getMemref ().getType ()));
1688
1688
base = genBoxOffsetGep (rewriter, loc, base, llvmBaseType, ptrOffset,
@@ -1843,7 +1843,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
1843
1843
if (!rebox.getSubcomponent ().empty ())
1844
1844
getSubcomponentIndices (rebox, rebox.getBox (), operands, fieldIndices);
1845
1845
if (!rebox.getSubstr ().empty ())
1846
- substringOffset = operands[rebox.substrOffset ()];
1846
+ substringOffset = operands[rebox.getSubstrOperandIndex ()];
1847
1847
base = genBoxOffsetGep (rewriter, loc, base, llvmBaseObjectType, zero,
1848
1848
/* cstInteriorIndices=*/ std::nullopt, fieldIndices,
1849
1849
substringOffset);
@@ -1862,8 +1862,8 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
1862
1862
llvm::SmallVector<mlir::Value> slicedStrides;
1863
1863
mlir::Value one = genConstantIndex (loc, idxTy, rewriter, 1 );
1864
1864
const bool sliceHasOrigins = !rebox.getShift ().empty ();
1865
- unsigned sliceOps = rebox.sliceOffset ();
1866
- unsigned shiftOps = rebox.shiftOffset ();
1865
+ unsigned sliceOps = rebox.getSliceOperandIndex ();
1866
+ unsigned shiftOps = rebox.getShiftOperandIndex ();
1867
1867
auto strideOps = inputStrides.begin ();
1868
1868
const unsigned inputRank = inputStrides.size ();
1869
1869
for (unsigned i = 0 ; i < inputRank;
@@ -1912,9 +1912,10 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
1912
1912
mlir::Value base, mlir::ValueRange inputExtents,
1913
1913
mlir::ValueRange inputStrides, mlir::ValueRange operands,
1914
1914
mlir::ConversionPatternRewriter &rewriter) const {
1915
- mlir::ValueRange reboxShifts{operands.begin () + rebox.shiftOffset (),
1916
- operands.begin () + rebox.shiftOffset () +
1917
- rebox.getShift ().size ()};
1915
+ mlir::ValueRange reboxShifts{
1916
+ operands.begin () + rebox.getShiftOperandIndex (),
1917
+ operands.begin () + rebox.getShiftOperandIndex () +
1918
+ rebox.getShift ().size ()};
1918
1919
if (rebox.getShape ().empty ()) {
1919
1920
// Only setting new lower bounds.
1920
1921
return finalizeRebox (rebox, destBoxTy, dest, base, reboxShifts,
@@ -1934,7 +1935,7 @@ struct XReboxOpConversion : public EmboxCommonConversion<fir::cg::XReboxOp> {
1934
1935
? genConstantIndex (loc, idxTy, rewriter, 1 )
1935
1936
: inputStrides[0 ];
1936
1937
for (unsigned i = 0 ; i < rebox.getShape ().size (); ++i) {
1937
- mlir::Value rawExtent = operands[rebox.shapeOffset () + i];
1938
+ mlir::Value rawExtent = operands[rebox.getShapeOperandIndex () + i];
1938
1939
mlir::Value extent = integerCast (loc, rewriter, idxTy, rawExtent);
1939
1940
newExtents.emplace_back (extent);
1940
1941
newStrides.emplace_back (stride);
@@ -2137,10 +2138,10 @@ struct XArrayCoorOpConversion
2137
2138
assert (coor.getShift ().empty () || coor.getShift ().size () == rank);
2138
2139
assert (coor.getSlice ().empty () || coor.getSlice ().size () == 3 * rank);
2139
2140
mlir::Type idxTy = lowerTy ().indexType ();
2140
- unsigned indexOffset = coor.indicesOffset ();
2141
- unsigned shapeOffset = coor.shapeOffset ();
2142
- unsigned shiftOffset = coor.shiftOffset ();
2143
- unsigned sliceOffset = coor.sliceOffset ();
2141
+ unsigned indexOffset = coor.getIndicesOperandIndex ();
2142
+ unsigned shapeOffset = coor.getShapeOperandIndex ();
2143
+ unsigned shiftOffset = coor.getShiftOperandIndex ();
2144
+ unsigned sliceOffset = coor.getSliceOperandIndex ();
2144
2145
auto sliceOps = coor.getSlice ().begin ();
2145
2146
mlir::Value one = genConstantIndex (loc, idxTy, rewriter, 1 );
2146
2147
mlir::Value prevExt = one;
@@ -2238,7 +2239,7 @@ struct XArrayCoorOpConversion
2238
2239
}
2239
2240
llvm::SmallVector<mlir::Value> indices = convertSubcomponentIndices (
2240
2241
loc, elementType,
2241
- operands.slice (coor.subcomponentOffset (),
2242
+ operands.slice (coor.getSubcomponentOperandIndex (),
2242
2243
coor.getSubcomponent ().size ()));
2243
2244
args.append (indices.begin (), indices.end ());
2244
2245
rewriter.replaceOpWithNewOp <mlir::LLVM::GEPOp>(coor, llvmPtrTy,
@@ -2262,7 +2263,7 @@ struct XArrayCoorOpConversion
2262
2263
if (fir::characterWithDynamicLen (eleTy)) {
2263
2264
assert (coor.getLenParams ().size () == 1 );
2264
2265
auto length = integerCast (loc, rewriter, idxTy,
2265
- operands[coor.lenParamsOffset ()]);
2266
+ operands[coor.getLenParamsOperandIndex ()]);
2266
2267
offset = rewriter.create <mlir::LLVM::MulOp>(loc, idxTy, offset,
2267
2268
length, nsw);
2268
2269
} else {
@@ -2275,7 +2276,7 @@ struct XArrayCoorOpConversion
2275
2276
args.push_back (offset);
2276
2277
llvm::SmallVector<mlir::Value> indices = convertSubcomponentIndices (
2277
2278
loc, gepObjectType,
2278
- operands.slice (coor.subcomponentOffset (),
2279
+ operands.slice (coor.getSubcomponentOperandIndex (),
2279
2280
coor.getSubcomponent ().size ()));
2280
2281
args.append (indices.begin (), indices.end ());
2281
2282
}
0 commit comments