[llvm] [NFC] Add useFPRegsForHalfType(). (PR #74147)

Harald van Dijk via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 3 09:25:52 PST 2023


hvdijk wrote:

Ah, thank you, I see what you mean and what's going wrong. What you say shouldn't be an issue directly, but you are right that this PR is incorrect. Inside functions, I continue to use `MVT::i16` for representing `half` values. The conversion to/from `f32` is handled before that, so the issue in those `SoftPromoteHalf` functions should never come up, their assumptions about `i16` should continue to hold. However, that conversion to/from `f32` is done wrong, so rather than `f16` values promoted to `f32`, those registers hold `f16` values as `i16`, extended to `i32`, bitcast to `f32`. And this did not come up in my testing because it is an ABI-incompatibility that can only be seen by mixing object files from current LLVM with my patched LLVM, which I had not done in my testing. I'll work on fixing that.

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


More information about the llvm-commits mailing list