File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
mlir/lib/Dialect/SPIRV/IR Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff 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 "
You can’t perform that action at this time.
0 commit comments