Skip to content

Commit 978310f

Browse files
authored
[mlir][vector][nfc] Fix typos in "VectorEmulateNarrowType.cpp" (#125415)
Updates `emulatedVectorLoad` that was introduced in #115922. Specifically, ATM `emulatedVectorLoad` mixes "emulated type" and "container type". This only became clear after #123526 in which the concepts of "emulated" and "container" types were introduced. This is an NFC change and simply updates the variable naming.
1 parent e3fbf19 commit 978310f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp

+13-11
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,25 @@ static Value dynamicallyInsertSubVector(RewriterBase &rewriter, Location loc,
278278
return dest;
279279
}
280280

281-
/// Returns the op sequence for an emulated sub-byte data type vector load.
282-
/// specifically, use `emulatedElemType` for loading a vector of `origElemType`.
283-
/// The load location is given by `base` and `linearizedIndices`, and the
284-
/// load size is given by `numEmulatedElementsToLoad`.
281+
/// Emulate a vector load for `emulatedElemTy` using `containerElemTy`
282+
///
283+
/// Specifically, use `containerElemTy` for loading a vector of
284+
/// `emulatedElemTy`. The load location is given by `base` and
285+
/// `linearizedIndices`, and the load size is given by
286+
/// `numEmulatedElementsToLoad`.
285287
static VectorValue emulatedVectorLoad(OpBuilder &rewriter, Location loc,
286288
Value base,
287289
OpFoldResult linearizedIndices,
288-
int64_t numEmultedElementsToLoad,
289-
Type origElemType,
290-
Type emulatedElemType) {
291-
auto scale = emulatedElemType.getIntOrFloatBitWidth() /
292-
origElemType.getIntOrFloatBitWidth();
290+
int64_t numContainerElemsToLoad,
291+
Type emulatedElemTy,
292+
Type containerElemTy) {
293+
auto scale = containerElemTy.getIntOrFloatBitWidth() /
294+
emulatedElemTy.getIntOrFloatBitWidth();
293295
auto newLoad = rewriter.create<vector::LoadOp>(
294-
loc, VectorType::get(numEmultedElementsToLoad, emulatedElemType), base,
296+
loc, VectorType::get(numContainerElemsToLoad, containerElemTy), base,
295297
getValueOrCreateConstantIndexOp(rewriter, loc, linearizedIndices));
296298
return rewriter.create<vector::BitCastOp>(
297-
loc, VectorType::get(numEmultedElementsToLoad * scale, origElemType),
299+
loc, VectorType::get(numContainerElemsToLoad * scale, emulatedElemTy),
298300
newLoad);
299301
}
300302

0 commit comments

Comments
 (0)