[llvm] [AMDGPU] Select 64-bit imm moves if can be encoded as 32 bit operand (PR #70395)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 10:40:32 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)
----------------
rampitec wrote:

Added comment.

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


More information about the llvm-commits mailing list