[llvm] [AMDGPU] Replace `isInlinableLiteral16` with specific version (PR #81345)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 09:15:35 PST 2024


================
@@ -2652,13 +2652,28 @@ bool isInlinableLiteral32(int32_t Literal, bool HasInv2Pi) {
          (Val == 0x3e22f983 && HasInv2Pi);
 }
 
-bool isInlinableLiteral16(int16_t Literal, bool HasInv2Pi) {
+bool isInlinableLiteralI16(int16_t Literal, bool HasInv2Pi) {
+  if (!HasInv2Pi)
+    return false;
+  if (isInlinableIntLiteral(Literal))
+    return true;
+  return (Literal == static_cast<int16_t>(llvm::bit_cast<uint32_t>(0.0f))) ||
----------------
shiltian wrote:

I think most of the values here are actually `0`, except the last one.

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


More information about the llvm-commits mailing list