[llvm] [NFC][LLVM] Refactor rounding mode detection of constrained fp intrinsic IDs (PR #90854)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 08:55:18 PDT 2024


================
@@ -1491,7 +1491,19 @@ bool Intrinsic::isConstrainedFPIntrinsic(ID QID) {
 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)                         \
   case Intrinsic::INTRINSIC:
 #include "llvm/IR/ConstrainedOps.def"
+#undef INSTRUCTION
     return true;
+  default:
+    return false;
+  }
+}
+
+bool Intrinsic::hasConstrainedFPRoundingModeOperand(Intrinsic::ID QID) {
----------------
paulwalker-arm wrote:

I'd rather hold off of that for now but it does feed into my next step of adding support for target intrinsics.  

Currently I'm pinning everything on `IntrStrictFP`, which is perhaps a mistake and I should be more explicit and introduce dedicated `IntrhasRoundMetadata` and `IntrHasFPExpectMetadata` properties?

If acceptable I can follow this patch with that refactoring? I'm already planning to generate the case blocks so most uses of ConstrainedOps.def at the IR level is removed.

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


More information about the llvm-commits mailing list