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

Artem Tyurin via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 05:54:09 PST 2024


================
@@ -117,6 +117,11 @@ class InstSimplifyFolder final : public IRBuilderFolder {
     return simplifyCastInst(Op, V, DestTy, SQ);
   }
 
+  Value *FoldBinaryIntrinsic(Intrinsic::ID ID, Value *LHS,
+                             Value *RHS) const override {
+    return simplifyBinaryIntrinsic(ID, LHS->getType(), LHS, RHS, SQ, nullptr);
----------------
agentcooper wrote:

I've updated the `FoldBinaryIntrinsic` definition to include a `Type *` parameter, which is be passed from `CreateBinaryIntrinsic` using `F->getReturnType()`.

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


More information about the llvm-commits mailing list