Commit 3eff3d8c authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r245530:

------------------------------------------------------------------------
r245530 | hfinkel | 2015-08-19 18:18:20 -0700 (Wed, 19 Aug 2015) | 5 lines

[PowerPC] Fix the int2fp(fp2int(x)) DAGCombine to ignore ppc_fp128

This DAGCombine was creating custom SDAG nodes with an illegal ppc_fp128
operand type because it was triggering on f64/f32 int2fp(fp2int(ppc_fp128 x)),
but shouldn't (it should only apply to f32/f64 types). The result was a crash.
------------------------------------------------------------------------

llvm-svn: 245573
parent bcbf19f9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -9966,6 +9966,9 @@ SDValue PPCTargetLowering::combineFPToIntToFP(SDNode *N,
    if (Src.getValueType() == MVT::f32) {
      Src = DAG.getNode(ISD::FP_EXTEND, dl, MVT::f64, Src);
      DCI.AddToWorklist(Src.getNode());
    } else if (Src.getValueType() != MVT::f64) {
      // Make sure that we don't pick up a ppc_fp128 source value.
      return SDValue();
    }

    unsigned FCTOp =
+16 −0
Original line number Diff line number Diff line
; RUN: llc -mcpu=a2 < %s | FileCheck %s
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-bgq-linux"

define linkonce_odr double @test1() {
entry:
  %conv6.i.i = fptosi ppc_fp128 undef to i64
  %conv.i = sitofp i64 %conv6.i.i to double
  ret double %conv.i

; CHECK-LABEL: @test1
; CHECK: bl __fixtfdi
; CHECK: fcfid
; CHECK: blr
}