@@ -2183,8 +2183,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
2183
2183
GEP->setIsInBounds (IsInbound);
2184
2184
V = GEP;
2185
2185
} else {
2186
- V = ConstantExpr::getGetElementPtr (BaseTy, dyn_cast <Constant>(Base),
2187
- Index, IsInbound);
2186
+ auto *CT = cast <Constant>(Base);
2187
+ V = ConstantExpr::getGetElementPtr (BaseTy, CT, Index, IsInbound);
2188
2188
}
2189
2189
return mapValue (BV, V);
2190
2190
}
@@ -2199,14 +2199,14 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
2199
2199
switch (static_cast <size_t >(BV->getType ()->getOpCode ())) {
2200
2200
case OpTypeVector:
2201
2201
return mapValue (BV, ConstantVector::get (CV));
2202
- case OpTypeArray:
2203
- return mapValue (
2204
- BV, ConstantArray::get (dyn_cast<ArrayType>( transType (CC-> getType ())),
2205
- CV));
2206
- case OpTypeStruct:
2207
- return mapValue (BV,
2208
- ConstantStruct::get (
2209
- dyn_cast<StructType>( transType (CC-> getType ())), CV));
2202
+ case OpTypeArray: {
2203
+ auto *AT = cast<ArrayType>( transType (CC-> getType ()));
2204
+ return mapValue ( BV, ConstantArray::get (AT, CV));
2205
+ }
2206
+ case OpTypeStruct: {
2207
+ auto *ST = cast<StructType>( transType (CC-> getType ()));
2208
+ return mapValue (BV, ConstantStruct::get (ST, CV));
2209
+ }
2210
2210
case internal::OpTypeJointMatrixINTEL:
2211
2211
return mapValue (BV, transSPIRVBuiltinFromInst (CC, BB));
2212
2212
default :
0 commit comments