Skip to content

Commit 746412a

Browse files
committed
[mlir] Document priority of alignment options.
Alignment can be specified either explicitly via attributes in vector operations or via the option to use-vector-alignment=<N> in the --convert-vector-to-llvm pass. The explicit attribute takes precedent over the option used as input to the pass.
1 parent b6e5aff commit 746412a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ class VectorLoadStoreConversion : public ConvertOpToLLVMPattern<LoadOrStoreOp> {
247247
MemRefType memRefTy = loadOrStoreOp.getMemRefType();
248248

249249
// Resolve alignment.
250+
// Explicit alignment takes priority over use-vector-alignment.
250251
unsigned align = loadOrStoreOp.getAlignment().value_or(0);
251252
if (!align &&
252253
failed(getVectorToLLVMAlignment(*this->getTypeConverter(), vectorTy,
@@ -299,6 +300,7 @@ class VectorGatherOpConversion
299300
}
300301

301302
// Resolve alignment.
303+
// Explicit alignment takes priority over use-vector-alignment.
302304
unsigned align = gather.getAlignment().value_or(0);
303305
if (!align &&
304306
failed(getVectorToLLVMAlignment(*this->getTypeConverter(), vType,
@@ -355,6 +357,7 @@ class VectorScatterOpConversion
355357
}
356358

357359
// Resolve alignment.
360+
// Explicit alignment takes priority over use-vector-alignment.
358361
unsigned align = scatter.getAlignment().value_or(0);
359362
if (!align &&
360363
failed(getVectorToLLVMAlignment(*this->getTypeConverter(), vType,

0 commit comments

Comments
 (0)