Skip to content

Commit 0174c86

Browse files
amd-eochoalokuhar
andauthored
Apply suggestions from code review
Co-authored-by: Jakub Kuderski <[email protected]>
1 parent d61481d commit 0174c86

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ struct VectorLoadOpConverter final
751751

752752
auto memoryAccess = spirv::MemoryAccess::None;
753753
spirv::MemoryAccessAttr memoryAccessAttr;
754-
IntegerAttr alignmentAttr = nullptr;
754+
IntegerAttr alignmentAttr;
755755
if (alignment.has_value()) {
756756
memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
757757
memoryAccessAttr =
@@ -820,7 +820,7 @@ struct VectorStoreOpConverter final
820820

821821
auto memoryAccess = spirv::MemoryAccess::None;
822822
spirv::MemoryAccessAttr memoryAccessAttr;
823-
IntegerAttr alignmentAttr = nullptr;
823+
IntegerAttr alignmentAttr;
824824
if (alignment.has_value()) {
825825
memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
826826
memoryAccessAttr =

mlir/test/Dialect/SPIRV/IR/invalid.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func.func @aligned_load_non_power_of_two() -> () {
2929
func.func @aligned_store_non_positive(%arg0 : f32) -> () {
3030
%0 = spirv.Variable : !spirv.ptr<f32, Function>
3131
// expected-error@below {{'spirv.Store' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
32-
spirv.Store "Function" %0, %arg0 ["Aligned", 0] : f32
32+
spirv.Store "Function" %0, %arg0 ["Aligned", 0] : f32
3333
return
3434
}
3535

@@ -38,6 +38,6 @@ func.func @aligned_store_non_positive(%arg0 : f32) -> () {
3838
func.func @aligned_store_non_power_of_two(%arg0 : f32) -> () {
3939
%0 = spirv.Variable : !spirv.ptr<f32, Function>
4040
// expected-error@below {{'spirv.Store' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
41-
spirv.Store "Function" %0, %arg0 ["Aligned", 3] : f32
41+
spirv.Store "Function" %0, %arg0 ["Aligned", 3] : f32
4242
return
4343
}

0 commit comments

Comments
 (0)