[llvm] Add IRBuilder::CreateFMA (PR #131112)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 13 03:07:02 PDT 2025


================
@@ -109,21 +109,13 @@ TEST_F(IRBuilderTest, Intrinsics) {
   EXPECT_TRUE(II->hasNoInfs());
   EXPECT_FALSE(II->hasNoNaNs());
 
-  Result = Builder.CreateIntrinsic(Intrinsic::fma, {V->getType()}, {V, V, V});
+  Result = Builder.CreateFMA(V, V, V);
   II = cast<IntrinsicInst>(Result);
   EXPECT_EQ(II->getIntrinsicID(), Intrinsic::fma);
   EXPECT_FALSE(II->hasNoInfs());
   EXPECT_FALSE(II->hasNoNaNs());
 
-  Result =
-      Builder.CreateIntrinsic(Intrinsic::fma, {V->getType()}, {V, V, V}, I);
-  II = cast<IntrinsicInst>(Result);
-  EXPECT_EQ(II->getIntrinsicID(), Intrinsic::fma);
-  EXPECT_TRUE(II->hasNoInfs());
-  EXPECT_FALSE(II->hasNoNaNs());
-
-  Result =
-      Builder.CreateIntrinsic(Intrinsic::fma, {V->getType()}, {V, V, V}, I);
----------------
arsenm wrote:

I more meant the new style where you directly supply the flags instead of a source instruction to copy from 

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


More information about the llvm-commits mailing list