Skip to content

Commit 3185ace

Browse files
[Codegen] Demand llvm.copysign.f{16,32,64,128} lowers without libcalls
1 parent 47e6d18 commit 3185ace

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

llvm/lib/CodeGen/IntrinsicLowering.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,16 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
438438
break;
439439
}
440440
case Intrinsic::copysign: {
441-
ReplaceFPIntrinsicWithCall(CI, "copysignf", "copysign", "copysignl");
441+
switch (CI->getArgOperand(0)->getType()->getTypeID()) {
442+
default:
443+
report_fatal_error("copysign intrinsic without arch-specific floats "
444+
"reached intrinsic-to-libcall lowering");
445+
break;
446+
case Type::X86_FP80TyID:
447+
case Type::PPC_FP128TyID:
448+
ReplaceCallWith("copysignl", CI, CI->arg_begin(), CI->arg_end(),
449+
Type::getFloatTy(CI->getContext()));
450+
}
442451
break;
443452
}
444453
case Intrinsic::get_rounding:

0 commit comments

Comments
 (0)