[llvm] [SelectionDAG] Add `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16` (PR #80056)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 02:27:17 PST 2024


================
@@ -3248,12 +3249,18 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
       Results.push_back(Tmp1);
     break;
   }
+  case ISD::STRICT_BF16_TO_FP:
+    // When strict mode is enforced we can't do expansion because it
+    // does not honor the "strict" properties.
+    if (TLI.isStrictFPEnabled())
----------------
arsenm wrote:

I don't understand why we have isStrictFPEnabled, but I think this check (and the hook more broadly) should be deleted. It's like we have 3 parallel mechanisms for supporting strictfp and this one makes the least sense. 

As far as this check goes, the target support of strictfp doesn't matter. This is going to fail to raise the required exceptions either way. 

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


More information about the llvm-commits mailing list