@@ -1747,7 +1747,7 @@ static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry,
1747
1747
for (unsigned i = 0 ; i < 4 ; i++) {
1748
1748
RemapSwizzle[i] = i;
1749
1749
if (NewBldVec[i].getOpcode () == ISD::EXTRACT_VECTOR_ELT) {
1750
- unsigned Idx = dyn_cast <ConstantSDNode>(NewBldVec[i].getOperand (1 ))
1750
+ unsigned Idx = cast <ConstantSDNode>(NewBldVec[i].getOperand (1 ))
1751
1751
->getZExtValue ();
1752
1752
if (i == Idx)
1753
1753
isUnmovable[Idx] = true ;
@@ -1756,7 +1756,7 @@ static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry,
1756
1756
1757
1757
for (unsigned i = 0 ; i < 4 ; i++) {
1758
1758
if (NewBldVec[i].getOpcode () == ISD::EXTRACT_VECTOR_ELT) {
1759
- unsigned Idx = dyn_cast <ConstantSDNode>(NewBldVec[i].getOperand (1 ))
1759
+ unsigned Idx = cast <ConstantSDNode>(NewBldVec[i].getOperand (1 ))
1760
1760
->getZExtValue ();
1761
1761
if (isUnmovable[Idx])
1762
1762
continue ;
@@ -2160,7 +2160,7 @@ bool R600TargetLowering::FoldOperand(SDNode *ParentNode, unsigned SrcIdx,
2160
2160
uint64_t ImmValue = 0 ;
2161
2161
2162
2162
if (Src.getMachineOpcode () == R600::MOV_IMM_F32) {
2163
- ConstantFPSDNode *FPC = dyn_cast <ConstantFPSDNode>(Src.getOperand (0 ));
2163
+ ConstantFPSDNode *FPC = cast <ConstantFPSDNode>(Src.getOperand (0 ));
2164
2164
float FloatValue = FPC->getValueAPF ().convertToFloat ();
2165
2165
if (FloatValue == 0.0 ) {
2166
2166
ImmReg = R600::ZERO;
@@ -2172,7 +2172,7 @@ bool R600TargetLowering::FoldOperand(SDNode *ParentNode, unsigned SrcIdx,
2172
2172
ImmValue = FPC->getValueAPF ().bitcastToAPInt ().getZExtValue ();
2173
2173
}
2174
2174
} else {
2175
- ConstantSDNode *C = dyn_cast <ConstantSDNode>(Src.getOperand (0 ));
2175
+ ConstantSDNode *C = cast <ConstantSDNode>(Src.getOperand (0 ));
2176
2176
uint64_t Value = C->getZExtValue ();
2177
2177
if (Value == 0 ) {
2178
2178
ImmReg = R600::ZERO;
@@ -2189,8 +2189,7 @@ bool R600TargetLowering::FoldOperand(SDNode *ParentNode, unsigned SrcIdx,
2189
2189
if (ImmReg == R600::ALU_LITERAL_X) {
2190
2190
if (!Imm.getNode ())
2191
2191
return false ;
2192
- ConstantSDNode *C = dyn_cast<ConstantSDNode>(Imm);
2193
- assert (C);
2192
+ ConstantSDNode *C = cast<ConstantSDNode>(Imm);
2194
2193
if (C->getZExtValue ())
2195
2194
return false ;
2196
2195
Imm = DAG.getTargetConstant (ImmValue, SDLoc (ParentNode), MVT::i32 );
0 commit comments