From 8edb9c3c56e88e38d82582e5fc96befca3d6223c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 8 Jul 2022 16:37:34 +0200 Subject: [ConstantExpr] Don't create float binop expressions Mark the fadd, fsub, fmul, fdiv, and frem expressions as undesirable, so they are not created automatically. This is in preparation for their removal. --- llvm/lib/IR/Constants.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/IR/Constants.cpp') diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index 650b076..9eefd01 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -2328,6 +2328,11 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) { case Instruction::SDiv: case Instruction::URem: case Instruction::SRem: + case Instruction::FAdd: + case Instruction::FSub: + case Instruction::FMul: + case Instruction::FDiv: + case Instruction::FRem: return false; case Instruction::Add: case Instruction::Sub: @@ -2338,11 +2343,6 @@ bool ConstantExpr::isDesirableBinOp(unsigned Opcode) { case Instruction::And: case Instruction::Or: case Instruction::Xor: - case Instruction::FAdd: - case Instruction::FSub: - case Instruction::FMul: - case Instruction::FDiv: - case Instruction::FRem: return true; default: llvm_unreachable("Argument must be binop opcode"); -- cgit v1.1