diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index e89deea7c91..bd4091a7e53 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -649,8 +649,8 @@ ComplexPairTy ComplexExprEmitter::EmitBinMul(const BinOpInfo &Op) { Value *ResR, *ResI; llvm::MDBuilder MDHelper(CGF.getLLVMContext()); - // XXX disable complex number builtin for now - if (false && Op.LHS.first->getType()->isFloatingPointTy()) { + // XXX disable complex number builtin for kernel compilation path for now + if (!CGF.CGM.getLangOpts().DevicePath && Op.LHS.first->getType()->isFloatingPointTy()) { // The general formulation is: // (a + ib) * (c + id) = (a * c - b * d) + i(a * d + b * c) // @@ -753,8 +753,8 @@ ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) { llvm::Value *DSTr, *DSTi; - // XXX disable complex number builtin for now - if (false && LHSr->getType()->isFloatingPointTy()) { + // XXX disable complex number builtin for kernel compilation path for now + if (!CGF.CGM.getLangOpts().DevicePath && LHSr->getType()->isFloatingPointTy()) { // If we have a complex operand on the RHS, we delegate to a libcall to // handle all of the complexities and minimize underflow/overflow cases. //