@@ -605,14 +605,7 @@ mlir::Type CIRGenTypes::ConvertType(QualType T) {
605605 const ReferenceType *RTy = cast<ReferenceType>(Ty);
606606 QualType ETy = RTy->getPointeeType ();
607607 auto PointeeType = convertTypeForMem (ETy);
608- // TODO(cir): when address space mapping in CIR lowering is implemented,
609- // passthrough these non-target address spaces like `opencl_global`
610- assert (!MissingFeatures::targetLoweringInfoAddressSpaceMap ());
611- // Here we convert them to target AS ahead of time
612- LangAS langAS = ETy.getAddressSpace ();
613- if (langAS != LangAS::Default)
614- langAS = getLangASFromTargetAS (Context.getTargetAddressSpace (langAS));
615- ResultType = Builder.getPointerTo (PointeeType, langAS);
608+ ResultType = Builder.getPointerTo (PointeeType, ETy.getAddressSpace ());
616609 assert (ResultType && " Cannot get pointer type?" );
617610 break ;
618611 }
@@ -627,14 +620,7 @@ mlir::Type CIRGenTypes::ConvertType(QualType T) {
627620 // if (PointeeType->isVoidTy())
628621 // PointeeType = Builder.getI8Type();
629622
630- // TODO(cir): when address space mapping in CIR lowering is implemented,
631- // passthrough these non-target address spaces like `opencl_global`
632- assert (!MissingFeatures::targetLoweringInfoAddressSpaceMap ());
633- // Here we convert them to target AS ahead of time
634- LangAS langAS = ETy.getAddressSpace ();
635- if (langAS != LangAS::Default)
636- langAS = getLangASFromTargetAS (Context.getTargetAddressSpace (langAS));
637- ResultType = Builder.getPointerTo (PointeeType, langAS);
623+ ResultType = Builder.getPointerTo (PointeeType, ETy.getAddressSpace ());
638624 assert (ResultType && " Cannot get pointer type?" );
639625 break ;
640626 }
0 commit comments