From d64262b5ebf9a6843f77177ed999ef3d5c95081f Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 29 Aug 2018 01:38:47 +0000 Subject: [PATCH] Start reserving x18 by default on Android targets. Differential Revision: https://reviews.llvm.org/D45588 llvm-svn: 340889 --- lib/Support/TargetParser.cpp | 3 ++- test/CodeGen/AArch64/arm64-platform-reg.ll | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Support/TargetParser.cpp b/lib/Support/TargetParser.cpp index 20aae02f5e5..1f580378c01 100644 --- a/lib/Support/TargetParser.cpp +++ b/lib/Support/TargetParser.cpp @@ -943,7 +943,8 @@ unsigned llvm::AArch64::parseArchVersion(StringRef Arch) { } bool llvm::AArch64::isX18ReservedByDefault(const Triple &TT) { - return TT.isOSDarwin() || TT.isOSFuchsia() || TT.isOSWindows(); + return TT.isAndroid() || TT.isOSDarwin() || TT.isOSFuchsia() || + TT.isOSWindows(); } struct GPUInfo { diff --git a/test/CodeGen/AArch64/arm64-platform-reg.ll b/test/CodeGen/AArch64/arm64-platform-reg.ll index 145066e697f..899759624c2 100644 --- a/test/CodeGen/AArch64/arm64-platform-reg.ll +++ b/test/CodeGen/AArch64/arm64-platform-reg.ll @@ -3,6 +3,7 @@ ; RUN: llc -mtriple=aarch64-fuchsia -mattr=+reserve-x20 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X20 ; RUN: llc -mtriple=aarch64-fuchsia -mattr=+reserve-x18,+reserve-x20 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18 --check-prefix=CHECK-RESERVE-X20 ; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s +; RUN: llc -mtriple=aarch64-linux-android -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18 ; RUN: llc -mtriple=aarch64-fuchsia -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18 ; RUN: llc -mtriple=aarch64-windows -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18