@@ -708,33 +708,37 @@ Serializer::processOp<spirv::CopyMemoryOp>(spirv::CopyMemoryOp op) {
708
708
operands.push_back (id);
709
709
}
710
710
711
- if (auto attr = op->getAttr (" memory_access" )) {
711
+ StringRef memory_access = op.getMemoryAccessAttrName ().strref ();
712
+ if (auto attr = op->getAttr (memory_access)) {
712
713
operands.push_back (
713
714
static_cast <uint32_t >(cast<spirv::MemoryAccessAttr>(attr).getValue ()));
714
715
}
715
716
716
- elidedAttrs.push_back (" memory_access" );
717
+ elidedAttrs.push_back (memory_access);
717
718
718
- if (auto attr = op->getAttr (" alignment" )) {
719
+ StringRef alignment = op.getAlignmentAttrName ().strref ();
720
+ if (auto attr = op->getAttr (alignment)) {
719
721
operands.push_back (static_cast <uint32_t >(
720
722
cast<IntegerAttr>(attr).getValue ().getZExtValue ()));
721
723
}
722
724
723
- elidedAttrs.push_back (" alignment" );
725
+ elidedAttrs.push_back (alignment);
724
726
725
- if (auto attr = op->getAttr (" source_memory_access" )) {
727
+ StringRef source_memory_access = op.getSourceMemoryAccessAttrName ().strref ();
728
+ if (auto attr = op->getAttr (source_memory_access)) {
726
729
operands.push_back (
727
730
static_cast <uint32_t >(cast<spirv::MemoryAccessAttr>(attr).getValue ()));
728
731
}
729
732
730
- elidedAttrs.push_back (" source_memory_access" );
733
+ elidedAttrs.push_back (source_memory_access);
731
734
732
- if (auto attr = op->getAttr (" source_alignment" )) {
735
+ StringRef source_alignment = op.getSourceAlignmentAttrName ().strref ();
736
+ if (auto attr = op->getAttr (source_alignment)) {
733
737
operands.push_back (static_cast <uint32_t >(
734
738
cast<IntegerAttr>(attr).getValue ().getZExtValue ()));
735
739
}
736
740
737
- elidedAttrs.push_back (" source_alignment" );
741
+ elidedAttrs.push_back (source_alignment);
738
742
if (failed (emitDebugLine (functionBody, op.getLoc ())))
739
743
return failure ();
740
744
encodeInstructionInto (functionBody, spirv::Opcode::OpCopyMemory, operands);
0 commit comments