Commit b7a003e0 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r245119:

------------------------------------------------------------------------
r245119 | nicholas | 2015-08-14 15:46:49 -0700 (Fri, 14 Aug 2015) | 2 lines

Fix a crash where a utility function wasn't aware of fcmp vectors and created a value with the wrong type. Fixes PR24458!

------------------------------------------------------------------------

llvm-svn: 245386
parent 4789b18c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -93,7 +93,8 @@ static Value *getFCmpValue(bool isordered, unsigned code,
  case 5: Pred = isordered ? FCmpInst::FCMP_ONE : FCmpInst::FCMP_UNE; break;
  case 6: Pred = isordered ? FCmpInst::FCMP_OLE : FCmpInst::FCMP_ULE; break;
  case 7:
    if (!isordered) return ConstantInt::getTrue(LHS->getContext());
    if (!isordered)
      return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 1);
    Pred = FCmpInst::FCMP_ORD; break;
  }
  return Builder->CreateFCmp(Pred, LHS, RHS);
+11 −0
Original line number Diff line number Diff line
@@ -150,3 +150,14 @@ entry:
  ret <4 x float> undef
}

define <8 x i32> @pr24458(<8 x float> %n) {
; CHECK-LABEL: @pr24458
  %notequal_b_load_.i = fcmp une <8 x float> %n, zeroinitializer
  %equal_a_load72_.i = fcmp ueq <8 x float> %n, zeroinitializer
  %notequal_b_load__to_boolvec.i = sext <8 x i1> %notequal_b_load_.i to <8 x i32>
  %equal_a_load72__to_boolvec.i = sext <8 x i1> %equal_a_load72_.i to <8 x i32>
  %wrong = or <8 x i32> %notequal_b_load__to_boolvec.i, %equal_a_load72__to_boolvec.i
  ret <8 x i32> %wrong
; CHECK-NEXT: ret <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
}