@@ -743,15 +743,14 @@ struct VectorLoadOpConverter final
743743
744744 auto vectorPtrType = spirv::PointerType::get (spirvVectorType, storageClass);
745745
746- auto alignment = loadOp.getAlignment ();
747- if (alignment.has_value () &&
748- alignment > std::numeric_limits<uint32_t >::max ()) {
746+ std::optional<uint64_t > alignment = loadOp.getAlignment ();
747+ if (alignment > std::numeric_limits<uint32_t >::max ()) {
749748 return rewriter.notifyMatchFailure (loadOp,
750749 " invalid alignment requirement" );
751750 }
752751
753752 auto memoryAccess = spirv::MemoryAccess::None;
754- auto memoryAccessAttr = spirv::MemoryAccessAttr{} ;
753+ spirv::MemoryAccessAttr memoryAccessAttr ;
755754 IntegerAttr alignmentAttr = nullptr ;
756755 if (alignment.has_value ()) {
757756 memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
@@ -800,8 +799,8 @@ struct VectorStoreOpConverter final
800799 return rewriter.notifyMatchFailure (
801800 storeOp, " failed to get memref element pointer" );
802801
803- auto alignment = storeOp.getAlignment ();
804- if (alignment && alignment > std::numeric_limits<uint32_t >::max ()) {
802+ std::optional< uint64_t > alignment = storeOp.getAlignment ();
803+ if (alignment > std::numeric_limits<uint32_t >::max ()) {
805804 return rewriter.notifyMatchFailure (storeOp,
806805 " invalid alignment requirement" );
807806 }
@@ -820,7 +819,7 @@ struct VectorStoreOpConverter final
820819 accessChain);
821820
822821 auto memoryAccess = spirv::MemoryAccess::None;
823- auto memoryAccessAttr = spirv::MemoryAccessAttr{} ;
822+ spirv::MemoryAccessAttr memoryAccessAttr ;
824823 IntegerAttr alignmentAttr = nullptr ;
825824 if (alignment.has_value ()) {
826825 memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
0 commit comments