[PATCH] D48580: [AArch64] Support reserving x1-7 registers.

Tri Vo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 10:04:00 PDT 2018


trong added inline comments.


================
Comment at: lib/Target/AArch64/AArch64.td:102
 
-def FeatureReserveX18 : SubtargetFeature<"reserve-x18", "ReserveX18", "true",
-                                         "Reserve X18, making it unavailable "
-                                         "as a GPR">;
-
-def FeatureReserveX20 : SubtargetFeature<"reserve-x20", "ReserveX20", "true",
-                                         "Reserve X20, making it unavailable "
-                                         "as a GPR">;
+foreach i = {1-7,18,20} in
+    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
----------------
manojgupta wrote:
> Can you support reserving all of the registers instead of a subset?
We probably can't reliably reserve some registers, e.g. x16, x17. And we would need more error handling for special usages of x19, x29 (maybe more). But I'd like to keep this change down to x1-7 since those are the ones that will actually be used.


https://reviews.llvm.org/D48580





More information about the llvm-commits mailing list