[llvm] [AMDGPU] Clean up functions for checking inline literals (PR #81282)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 02:06:38 PST 2024


================
@@ -797,16 +797,8 @@ def i64imm_32bit : ImmLeaf<i64, [{
   return (Imm & 0xffffffffULL) == static_cast<uint64_t>(Imm);
 }]>;
 
-def InlineImm16 : ImmLeaf<i16, [{
-  return isInlineImmediate16(Imm);
-}]>;
-
-def InlineImm32 : ImmLeaf<i32, [{
-  return isInlineImmediate32(Imm);
-}]>;
-
 def InlineImm64 : ImmLeaf<i64, [{
-  return isInlineImmediate64(Imm);
+  return isInlineImmediate(APInt(64, static_cast<uint64_t>(Imm)));
----------------
jayfoad wrote:

Can you use IntImmLeaf instead of ImmLeaf here? That way Imm will already be an APInt so you won't have to construct a new APInt.

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


More information about the llvm-commits mailing list