[llvm] [Mips] Fix wrong qNaN encoding when -mnan=legacy (PR #153777)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 08:12:36 PDT 2025


================
@@ -4433,6 +4433,10 @@ class LLVM_ABI TargetLowering : public TargetLoweringBase {
   ///
   virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
 
+  ///  For targets which need get QNaN by assigning a certain value to the
+  ///  parameter payload.
+  virtual APFloat getNaNValue(EVT VT) const;
----------------
arsenm wrote:

I do not want to add this hook. This is not how you would begin handling this properly. If you really, really want to hack this, it needs to be fully isolated in the mips backend. I do not want to taint any generic code without a strategy and intention to really support the old encoding. No code should have an obligation to try to handle or use this hook 

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


More information about the llvm-commits mailing list