[llvm] [IRBuilder] Fold binary intrinsics (PR #80743)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 07:20:43 PST 2024


================
@@ -191,12 +191,12 @@ class TargetFolder final : public IRBuilderFolder {
     return nullptr;
   }
 
-  Value *FoldBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS,
-                             Type *Ty) const override {
+  Value *FoldBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS, Type *Ty,
+                             Instruction *FMFSource = nullptr) const override {
     auto *C1 = dyn_cast<Constant>(LHS);
     auto *C2 = dyn_cast<Constant>(RHS);
     if (C1 && C2)
-      return ConstantFoldBinaryIntrinsic(ID, C1, C2, Ty);
+      return ConstantFoldBinaryIntrinsic(ID, C1, C2, Ty, FMFSource);
----------------
dtcxzyw wrote:

Oh, my bad. It is used to fold constrained fp intrinsics.


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


More information about the llvm-commits mailing list