Skip to content

Commit 7ee439b

Browse files
committed
Update comments
1 parent 470f06a commit 7ee439b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,15 @@ LogicalResult spirv::GlobalVariableOp::verify() {
12761276
Operation *initOp = SymbolTable::lookupNearestSymbolFrom(
12771277
(*this)->getParentOp(), init.getAttr());
12781278
// TODO: Currently only variable initialization with specialization
1279-
// constants and other variables is supported. They could be normal
1280-
// constants in the module scope as well.
1279+
// constants is supported. There could be normal constants in the module
1280+
// scope as well.
1281+
//
1282+
// In the current setup we also cannot initialize one global variable with
1283+
// another. The problem is that if we try to initialize pointer of type X
1284+
// with another pointer type, the validator fails because it expects the
1285+
// variable to be initialized to be type X, not pointer to X. Now
1286+
// `spirv.GlobalVariable` only allows pointer type, so in the current design
1287+
// we cannot initialize one `spirv.GlobalVariable` with another.
12811288
if (!initOp ||
12821289
!isa<spirv::SpecConstantOp, spirv::SpecConstantCompositeOp>(initOp)) {
12831290
return emitOpError("initializer must be result of a "

0 commit comments

Comments
 (0)