Skip to content

Commit

Permalink
Do not bail on fcmp ord (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
frabert authored Feb 22, 2023
1 parent 87c50e8 commit 0cccc98
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/AST/IRToASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0cccc98

Please sign in to comment.