[llvm] [AMDGPU] Select 64-bit moves (PR #70395)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 04:36:49 PDT 2023


================
@@ -1934,6 +1934,26 @@ def : GCNPat <
   (V_MOV_B32_e32 (f16 (bitcast_fpimm_to_i32 $imm)))
 >;
 
+def : GCNPat <
+  (VGPRImm<(i64 imm)>:$imm),
+  (V_MOV_B64_PSEUDO imm:$imm)
+>;
+
+def : GCNPat <
+  (VGPRImm<(f64 fpimm)>:$imm),
+  (V_MOV_B64_PSEUDO (f64 (bitcast_fpimm_to_i64 $imm)))
+>;
+
+def : GCNPat <
+  (i64 imm:$imm),
+  (S_MOV_B64_IMM_PSEUDO imm:$imm)
----------------
jayfoad wrote:

AIUI the whole point of S_MOV_B64_IMM_PSEUDO is that unlike S_MOV_B64 it can be used with any 64-bit imm, not just encodable ones. But here we're only going to select it for encodable constants after all. It would be nice to have a comment explaining all that. I guess the same applies to V_MOV_B64_PSEUDO.

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


More information about the llvm-commits mailing list