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