[PATCH] D63924: [AMDGPU] Created a sub-register class for the return address operand in the return instruction.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 12:32:53 PDT 2019


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:2237
+        &AMDGPU::CCR_SGPR_64RegClass), MVT::i64);
+    Chain = DAG.getCopyToReg(Chain, DL, ReturnAddrVirtualReg, ReturnAddrReg, Flag);
     Flag = Chain.getValue(1);
----------------
This line looks too long? Run clang-format?


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.td:492
+// CCR (call clobbered registers) SGPR 64-bit registers
+def CCR_SGPR_64 : RegisterClass<"AMDGPU", [v2i32, i64, v2f32, f64, v4i16, v4f16], 32, (add (trunc SGPR_64, 16))> {
+  let CopyCost = 1;
----------------
You should bee able to use SGPR_64.RegTypes to avoid repeating the type list


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.td:493-494
+def CCR_SGPR_64 : RegisterClass<"AMDGPU", [v2i32, i64, v2f32, f64, v4i16, v4f16], 32, (add (trunc SGPR_64, 16))> {
+  let CopyCost = 1;
+  let AllocationPriority = 9;
+}
----------------
You can also avoid repeating these with SGPR_64.CopyCost, and AllocationPriority


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63924/new/

https://reviews.llvm.org/D63924





More information about the llvm-commits mailing list