[PATCH] D11463: [AArch64] Define subtarget feature "reserve-x18"

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jul 27 10:03:40 PDT 2015


> On 2015-Jul-27, at 10:03, Eric Christopher <echristo at gmail.com> wrote:
> 
> 
> On Mon, Jul 27, 2015 at 10:02 AM Akira Hatanaka <ahatanak at gmail.com> wrote:
> ahatanak added inline comments.
> 
> ================
> Comment at: lib/Target/AArch64/AArch64RegisterInfo.cpp:402-403
> @@ -404,4 +401,4 @@
>      return 32 - 1                                // XZR/SP
> -           - (TFI->hasFP(MF) || TT.isOSDarwin()) // FP
> -           - (TT.isOSDarwin() || ReserveX18) // X18 reserved as platform register
> -           - hasBasePointer(MF);           // X19
> +      - (TFI->hasFP(MF) || TT.isOSDarwin()) // FP
> +      - (TT.isOSDarwin() ||
> +         MF.getSubtarget<AArch64Subtarget>()
> ----------------
> echristo wrote:
> > I wonder if the isOSDarwin parts here necessarily need to be here - should be able to fold them into either a) the subtarget feature existing, or b) the query in TFI?
> Yes, either the front-end should pass reserve-x18 if the target is darwin or we should have a function in subtarget or TFI that returns (isOSDDarwin() || isX18Reserved()).
> 
> Preferably the former.
I agree, that makes more sense to me.



More information about the llvm-commits mailing list