@@ -2763,7 +2763,12 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) {
2763
2763
#endif
2764
2764
report_fatal_error (" Do not know how to promote this operator's result!" );
2765
2765
2766
- case ISD::BITCAST: R = PromoteFloatRes_BITCAST (N); break ;
2766
+ case ISD::BITCAST:
2767
+ R = PromoteFloatRes_BITCAST (N);
2768
+ break ;
2769
+ case ISD::FREEZE:
2770
+ R = PromoteFloatRes_FREEZE (N);
2771
+ break ;
2767
2772
case ISD::ConstantFP: R = PromoteFloatRes_ConstantFP (N); break ;
2768
2773
case ISD::EXTRACT_VECTOR_ELT:
2769
2774
R = PromoteFloatRes_EXTRACT_VECTOR_ELT (N); break ;
@@ -2876,6 +2881,18 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_BITCAST(SDNode *N) {
2876
2881
return DAG.getNode (GetPromotionOpcode (VT, NVT), SDLoc (N), NVT, Cast);
2877
2882
}
2878
2883
2884
+ SDValue DAGTypeLegalizer::PromoteFloatRes_FREEZE (SDNode *N) {
2885
+ EVT VT = N->getValueType (0 );
2886
+ EVT NVT = TLI.getTypeToTransformTo (*DAG.getContext (), VT);
2887
+ // Input type isn't guaranteed to be a scalar int so bitcast if not. The
2888
+ // bitcast will be legalized further if necessary.
2889
+ EVT IVT = EVT::getIntegerVT (*DAG.getContext (),
2890
+ N->getOperand (0 ).getValueType ().getSizeInBits ());
2891
+ SDValue Cast = DAG.getBitcast (IVT, N->getOperand (0 ));
2892
+ return DAG.getNode (GetPromotionOpcode (VT, NVT), SDLoc (N), NVT,
2893
+ DAG.getFreeze (Cast));
2894
+ }
2895
+
2879
2896
SDValue DAGTypeLegalizer::PromoteFloatRes_ConstantFP (SDNode *N) {
2880
2897
ConstantFPSDNode *CFPNode = cast<ConstantFPSDNode>(N);
2881
2898
EVT VT = N->getValueType (0 );
0 commit comments