[mlir][spirv] Use type dyn_cast when scanning spv.GlobalVariable
authorLei Zhang <antiagainst@google.com>
Sun, 29 Aug 2021 16:01:19 +0000 (12:01 -0400)
committerLei Zhang <antiagainst@google.com>
Sun, 29 Aug 2021 16:01:19 +0000 (12:01 -0400)
commita5621e26dbc90be3d5af164978f6fcc398f0a1d1
tree3306027bfe88fdf0ffd13463a76ea02583bcff77
parentc58c0993c9f336a108f1ff65df8d8241bc4ba6d2
[mlir][spirv] Use type dyn_cast when scanning spv.GlobalVariable

This avoids crashes when there are spv.GlobalVariable without
pointer type.
mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp