Skip to content

Commit fc1d171

Browse files
authored
[SPIRV][NFC] Remove useless cast to Constant (#163935)
1 parent a43c0cf commit fc1d171

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,19 +1392,19 @@ void SPIRVEmitIntrinsics::preprocessCompositeConstants(IRBuilder<> &B) {
13921392
Constant *AggrConst = nullptr;
13931393
Type *ResTy = nullptr;
13941394
if (auto *COp = dyn_cast<ConstantVector>(Op)) {
1395-
AggrConst = cast<Constant>(COp);
1395+
AggrConst = COp;
13961396
ResTy = COp->getType();
13971397
} else if (auto *COp = dyn_cast<ConstantArray>(Op)) {
1398-
AggrConst = cast<Constant>(COp);
1398+
AggrConst = COp;
13991399
ResTy = B.getInt32Ty();
14001400
} else if (auto *COp = dyn_cast<ConstantStruct>(Op)) {
1401-
AggrConst = cast<Constant>(COp);
1401+
AggrConst = COp;
14021402
ResTy = B.getInt32Ty();
14031403
} else if (auto *COp = dyn_cast<ConstantDataArray>(Op)) {
1404-
AggrConst = cast<Constant>(COp);
1404+
AggrConst = COp;
14051405
ResTy = B.getInt32Ty();
14061406
} else if (auto *COp = dyn_cast<ConstantAggregateZero>(Op)) {
1407-
AggrConst = cast<Constant>(COp);
1407+
AggrConst = COp;
14081408
ResTy = Op->getType()->isVectorTy() ? COp->getType() : B.getInt32Ty();
14091409
}
14101410
if (AggrConst) {

0 commit comments

Comments
 (0)