This code calls `getInitializer` without checking if the global has an initializer, which causes an assert if there isn't one. These globals may have no initializer after optimization from `globalopt`. Check for an initializer first. This is already locked down with `CodeGen/SPIRV/legalize-zero-size-arrays-appending.ll` so we don't need a new test. This issue was exposed by https://github.com/llvm/llvm-project/pull/192730. Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
10 KiB
10 KiB