[llvm] [AArch64][CodeGen] Fix crash when fptrunc returns fp16 with +nofp attr (PR #81724)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 17 01:48:19 PST 2024


davemgreen wrote:

This looks like it's on the right track. I think it should be based on hasFPARMv8, not hasFullFP16.

If I change this to only be custom when we have fp16:
```
-  setOperationAction(ISD::FP_ROUND, MVT::f16, Custom);  
+  if (!Subtarget->hasFPARMv8())                         
+    setOperationAction(ISD::FP_ROUND, MVT::f16, Custom);
```

It runs into problems with BITCAST, so If I do the same thing there for the i16/f16/bf16 types then the test compiles, but produces multiple calls that might not be expected. I didn't look too deeply into why that was happening, and there is a chance it might cause problems in other places, but we don't have a lot of tests for "no-fp" codegen so far.

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


More information about the llvm-commits mailing list