Skip to content

Commit c8eb67b

Browse files
[Codegen] Demand llvm.copysign.f{16,32,64,128} lowers without libcalls
1 parent 3e742b7 commit c8eb67b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llvm/lib/CodeGen/IntrinsicLowering.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,15 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
442442
break;
443443
}
444444
case Intrinsic::copysign: {
445-
ReplaceFPIntrinsicWithCall(CI, "copysignf", "copysign", "copysignl");
445+
switch (CI->getArgOperand(0)->getType()->getTypeID()) {
446+
default:
447+
assert(false && "only need a copysign libcall for arch-specific floats");
448+
break;
449+
case Type::X86_FP80TyID:
450+
case Type::PPC_FP128TyID:
451+
ReplaceCallWith("copysignl", CI, CI->arg_begin(), CI->arg_end(),
452+
Type::getFloatTy(CI->getContext()));
453+
}
446454
break;
447455
}
448456
case Intrinsic::get_rounding:

0 commit comments

Comments
 (0)