llvm-project
f814a7cc - [NVPTX] Restrict NVVM bf16 intrinsic upgrades to integer storage types (#197387)

Commit
9 days ago
[NVPTX] Restrict NVVM bf16 intrinsic upgrades to integer storage types (#197387) ### Summary This PR resolves https://github.com/llvm/llvm-project/issues/196793. ### Problem NVVM bf16 intrinsics used to be represented with integer storage types before switching to bfloat signatures. AutoUpgrade currently upgrades any matching NVVM bf16 intrinsic whose return type is not already bfloat. That is too broad: invalid declarations such as a half-returning llvm.nvvm.neg.bf16 are treated as old intrinsics and later crash when the upgraded bfloat call is RAUW'ed with the original half-typed call. Only perform this upgrade when the old signature uses integer storage types with the same primitive bit widths as the new bf16 signature. Otherwise leave the invalid intrinsic for the verifier to diagnose. Add coverage for invalid half and mismatched integer signatures.
Author
Parents
Loading