From 78fd3c27d6d74518f8921679947927e9a3b762ac Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Thu, 15 Aug 2024 14:45:49 +0200 Subject: [PATCH] replace llvm_unreachable with assertion --- clang/lib/CodeGen/CGBuiltin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index b0a0c41118da4a..479c1f57218cbf 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -18709,9 +18709,9 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: { retType = llvm::VectorType::get( retType, ElementCount::getFixed(XVecTy->getNumElements())); } - if (!E->getArg(0)->getType()->hasFloatingRepresentation() && - !E->getArg(0)->getType()->hasSignedIntegerRepresentation()) - llvm_unreachable("sign operand must have a float or int representation"); + assert((E->getArg(0)->getType()->hasFloatingRepresentation() || + E->getArg(0)->getType()->hasSignedIntegerRepresentation()) && + "sign operand must have a float or int representation"); return Builder.CreateIntrinsic( retType, CGM.getHLSLRuntime().getSignIntrinsic(),