@@ -805,13 +805,6 @@ mlir::LogicalResult cir::VectorType::verify(
805805// TargetAddressSpace definitions
806806// ===----------------------------------------------------------------------===//
807807
808- // Convert from TargetAddressSpaceAttr to the actual integer address space.
809- unsigned cir::getTargetAddrSpaceFromAttr (cir::TargetAddressSpaceAttr attr) {
810- if (!attr)
811- return 0 ; // Default address space is 0 in LLVM.
812- return attr.getValue ().getUInt ();
813- }
814-
815808mlir::ParseResult parseTargetAddressSpace (mlir::AsmParser &p,
816809 cir::TargetAddressSpaceAttr &attr) {
817810 if (failed (p.parseKeyword (" target_address_space" )))
@@ -820,7 +813,7 @@ mlir::ParseResult parseTargetAddressSpace(mlir::AsmParser &p,
820813 if (failed (p.parseLParen ()))
821814 return mlir::failure ();
822815
823- int64_t targetValue;
816+ int32_t targetValue;
824817 if (failed (p.parseInteger (targetValue)))
825818 return p.emitError (p.getCurrentLocation (),
826819 " expected integer address space value" );
@@ -830,9 +823,8 @@ mlir::ParseResult parseTargetAddressSpace(mlir::AsmParser &p,
830823 " expected ')' after address space value" );
831824
832825 mlir::MLIRContext *context = p.getBuilder ().getContext ();
833- auto intTy = mlir::IntegerType::get (context, 32 );
834826 attr = cir::TargetAddressSpaceAttr::get (
835- context, mlir::IntegerAttr::get (intTy, targetValue));
827+ context, p. getBuilder (). getUI32IntegerAttr ( targetValue));
836828 return mlir::success ();
837829}
838830
0 commit comments