Skip to content

Commit 04fee3b

Browse files
committed
Update CIRGenModule.cpp
1 parent c80334d commit 04fee3b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenModule.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
11211121
}
11221122
}
11231123

1124-
// TODO(cir): LLVM codegen makes sure the result is of the correct type
1125-
// by issuing a address space cast.
1126-
if (entryCIRAS != cirAS)
1127-
llvm_unreachable("NYI");
1124+
// Address space check removed because it is unnecessary because CIR records address space info in types.
11281125

11291126
// (If global is requested for a definition, we always need to create a new
11301127
// global, not just return a bitcast.)
@@ -1495,7 +1492,7 @@ void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *d,
14951492
// __shared__ variables is not marked as externally initialized,
14961493
// because they must not be initialized.
14971494
if (linkage != cir::GlobalLinkageKind::InternalLinkage &&
1498-
(d->hasAttr<CUDADeviceAttr>())) {
1495+
(d->hasAttr<CUDADeviceAttr>() || d->getType()->isCUDADeviceBuiltinSurfaceType())) {
14991496
gv->setAttr(CUDAExternallyInitializedAttr::getMnemonic(),
15001497
CUDAExternallyInitializedAttr::get(&getMLIRContext()));
15011498
}

0 commit comments

Comments
 (0)