[PATCH] D69562: Mapping of FP operations to constrained intrinsics

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 10:46:01 PST 2019


arsenm added inline comments.


================
Comment at: llvm/lib/IR/FloatingPoint.cpp:85
+  case Instruction::FAdd:
+    IID = Intrinsic::experimental_constrained_fadd;
+    break;
----------------
I would prefer direct returns rather than variable assign and break


================
Comment at: llvm/lib/IR/FloatingPoint.cpp:172
+      default:
+        break;
+      }
----------------
I think this should assert or something on unhandled target intrinsics. Right now it will just return then original ID which is probably not expected


================
Comment at: llvm/unittests/IR/InstructionsTest.cpp:436-437
+    auto *I = cast<Instruction>(Builder.CreateFAdd(Arg0, Arg0));
+    EXPECT_TRUE(getConstrainedIntrinsic(*I)
+                == Intrinsic::experimental_constrained_fadd);
+  }
----------------
EXPECT_EQ


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69562/new/

https://reviews.llvm.org/D69562





More information about the llvm-commits mailing list