[llvm] [LLVM][InstSimplify] Refactor simplifyBinaryIntrinsic to remove Call operand. (PR #196309)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 11:53:33 PDT 2026
================
@@ -121,8 +121,10 @@ class LLVM_ABI InstSimplifyFolder final : public IRBuilderFolder {
Value *FoldBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS, Type *Ty,
Instruction *FMFSource = nullptr) const override {
- return simplifyBinaryIntrinsic(ID, Ty, LHS, RHS, SQ,
- dyn_cast_if_present<CallBase>(FMFSource));
+ FastMathFlags FMF;
+ if (auto *FPMO = dyn_cast_if_present<FPMathOperator>(FMFSource))
+ FMF = FPMO->getFastMathFlags();
----------------
nikic wrote:
It looks like this FMFSource argument is actually dead code, the only user passes null: https://github.com/llvm/llvm-project/blob/02c8eb80ae0d5bd841c81b5439cee197b29fe4fc/llvm/lib/IR/IRBuilder.cpp#L924-L925
This FMFSource argument should really just be an FMF argument as well and use `FMFSource.get(FMF)` as the value...
https://github.com/llvm/llvm-project/pull/196309
More information about the llvm-commits
mailing list