craig.topper added a comment.

There's an oddity with fma. The version without __builtin has 'e' already

  LIBBUILTIN(fma, "dddd", "fne", "math.h", ALL_LANGUAGES)
  LIBBUILTIN(fmaf, "ffff", "fne", "math.h", ALL_LANGUAGES)
  LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES)

But we don't check the const attribute in CGBuiltin.cpp before converting it to 
an intrinsic

  case Builtin::BIfma:
  case Builtin::BIfmaf:
  case Builtin::BIfmal:
  case Builtin::BI__builtin_fma:
  case Builtin::BI__builtin_fmaf:
  case Builtin::BI__builtin_fmal: {
    // Rewrite fma to intrinsic.
    Value *FirstArg = EmitScalarExpr(E->getArg(0));
    llvm::Type *ArgType = FirstArg->getType();
    Value *F = CGM.getIntrinsic(Intrinsic::fma, ArgType);
    return RValue::get(
        Builder.CreateCall(F, {FirstArg, EmitScalarExpr(E->getArg(1)),
                               EmitScalarExpr(E->getArg(2))}));
  }


https://reviews.llvm.org/D39481



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to