File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -761,20 +761,21 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFREXP(SDNode *N) {
761761 EVT VT0 = N->getValueType (0 );
762762 EVT VT1 = N->getValueType (1 );
763763 RTLIB::Libcall LC = RTLIB::getFREXP (VT0);
764+ EVT NVT0 = TLI.getTypeToTransformTo (*DAG.getContext (), VT0);
765+ SDLoc DL (N);
764766
765767 if (DAG.getLibInfo ().getIntSize () != VT1.getSizeInBits ()) {
766768 // If the exponent does not match with sizeof(int) a libcall would use the
767769 // wrong type for the argument.
768770 // TODO: Should be able to handle mismatches.
769771 DAG.getContext ()->emitError (" ffrexp exponent does not match sizeof(int)" );
770- return DAG.getUNDEF (N->getValueType (0 ));
772+ SDValue PoisonExp = DAG.getPOISON (VT1);
773+ ReplaceValueWith (SDValue (N, 1 ), PoisonExp);
774+ return DAG.getMergeValues ({DAG.getPOISON (NVT0), PoisonExp}, DL);
771775 }
772776
773- EVT NVT0 = TLI.getTypeToTransformTo (*DAG.getContext (), VT0);
774777 SDValue StackSlot = DAG.CreateStackTemporary (VT1);
775778
776- SDLoc DL (N);
777-
778779 auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
779780 TargetLowering::MakeLibCallOptions CallOptions;
780781 SDValue Ops[2 ] = {GetSoftenedFloat (N->getOperand (0 )), StackSlot};
Original file line number Diff line number Diff line change 1+ ; RUN: not llc -mtriple arm-linux-gnu -float-abi=soft -filetype=null %s 2>&1 | FileCheck %s
2+
3+ ; FIXME: This should not fail but isn't implemented
4+ ; CHECK: error: ffrexp exponent does not match sizeof(int)
5+ define { float , i64 } @soften_frexp_error (float %x ) {
6+ %frexp = call { float , i64 } @llvm.frexp.f32.i64 (float %x )
7+ ret { float , i64 } %frexp
8+ }
You can’t perform that action at this time.
0 commit comments