Skip to content

Commit 6134c74

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

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
@@ -438,7 +438,15 @@ 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::PPC_FP128TyID:
447+
ReplaceCallWith("copysignl", CI, CI->arg_begin(), CI->arg_end(),
448+
Type::getFloatTy(CI->getContext()));
449+
}
442450
break;
443451
}
444452
case Intrinsic::get_rounding:

0 commit comments

Comments
 (0)