[llvm] [IR] Store fast-math flags in subclasses of Instruction (PR #191190)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 01:09:09 PDT 2026


================
@@ -2717,7 +2719,11 @@ BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2,
                                        InsertPosition InsertBefore) {
   assert(S1->getType() == S2->getType() &&
          "Cannot create binary operator with two operands of differing type!");
-  return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertBefore);
+  return FPMathOperator::isSupportedFloatingPointType(S1->getType())
----------------
aengelke wrote:

switch on opcode instead? I don't think isSupportedFloatingPointType is cheaper than that.

https://github.com/llvm/llvm-project/pull/191190


More information about the llvm-commits mailing list