[llvm] [X86] Support EGPR (R16-R31) for APX (PR #67702)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 7 19:50:39 PDT 2023


================
@@ -73,6 +73,42 @@ def R12B : X86Reg<"r12b", 12>;
 def R13B : X86Reg<"r13b", 13>;
 def R14B : X86Reg<"r14b", 14>;
 def R15B : X86Reg<"r15b", 15>;
+// RAGreedy prefers to select a cheaper register
+// For x86,
+//   Cost(caller-save reg) < Cost(callee-save reg)
+// b/c callee-save register needs push/pop in prolog/epilog.
+// If both registers are callee-saved or caller-saved,
+//   Cost(short-encoding reg) < Cost(long-encoding reg)
+//
+// To achieve this, we do the following things:
+//   1. Set CostPerUse=1 for registers that need prefix
----------------
phoebewang wrote:

Where is it set?

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


More information about the llvm-commits mailing list