From 17404ef9c4889d4f4faf02766bd07c8191059ea4 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Wed, 22 Feb 2023 15:33:47 +0100 Subject: [PATCH] Do not bail on `fcmp ord` --- lib/AST/IRToASTVisitor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/AST/IRToASTVisitor.cpp b/lib/AST/IRToASTVisitor.cpp index 9760667b..5fb781ff 100755 --- a/lib/AST/IRToASTVisitor.cpp +++ b/lib/AST/IRToASTVisitor.cpp @@ -851,6 +851,11 @@ clang::Expr *ExprGen::visitCmpInst(llvm::CmpInst &inst) { ast.CreateBuiltinCall(clang::Builtin::BI__builtin_isunordered, args); break; + case llvm::CmpInst::FCMP_ORD: + res = ast.CreateLNot( + ast.CreateBuiltinCall(clang::Builtin::BI__builtin_isunordered, args)); + break; + case llvm::CmpInst::FCMP_TRUE: res = ast.CreateTrue(); break; @@ -860,7 +865,7 @@ clang::Expr *ExprGen::visitCmpInst(llvm::CmpInst &inst) { break; default: - THROW() << "Unknown CmpInst predicate: " << inst.getOpcodeName(); + THROW() << "Unknown CmpInst predicate: " << LLVMThingToString(&inst); return nullptr; } return res;