[PATCH] D110322: [ConstantFolding] Fold constrained compare intrinsics

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 13:47:11 PST 2021


craig.topper added a comment.

Should the change that effects fadd, fma, etc. tests be moved to a different patch?



================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2293
+  FCmpInst::Predicate Cond = FCmp->getPredicate();
+  if (IntrinsicID == Intrinsic::experimental_constrained_fcmp) {
+    if (Op1.isSignaling() || Op2.isSignaling())
----------------
Does ConstrainedFPCmpIntrinsic have any method for determining fcmp vs fcmps? If not should it?


================
Comment at: llvm/lib/IR/Instructions.cpp:4243
 
+bool FCmpInst::evaluate(Predicate Pred, const APFloat &Op1,
+                        const APFloat &Op2) {
----------------
This feels a little like it shouldn't be part of FCmpInst, but I don't have a concrete suggestion of where to put it instead. ConstantFold.cpp feels like the right home, but unfortunatley the header for that isn't visible to ConstantFolding.cpp.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110322



More information about the llvm-commits mailing list