2014-05-24 20:50:23 +08:00
|
|
|
//===-- AArch64Subtarget.cpp - AArch64 Subtarget Information ----*- C++ -*-===//
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2014-05-24 20:50:23 +08:00
|
|
|
// This file implements the AArch64 specific subclass of TargetSubtarget.
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-05-26 05:37:29 +08:00
|
|
|
#include "AArch64Subtarget.h"
|
2017-05-02 05:53:19 +08:00
|
|
|
|
|
|
|
#include "AArch64.h"
|
|
|
|
#include "AArch64CallLowering.h"
|
2018-11-27 05:47:28 +08:00
|
|
|
#include "AArch64InstrInfo.h"
|
2017-05-02 05:53:19 +08:00
|
|
|
#include "AArch64LegalizerInfo.h"
|
2018-11-27 05:47:28 +08:00
|
|
|
#include "AArch64PBQPRegAlloc.h"
|
2017-05-02 05:53:19 +08:00
|
|
|
#include "AArch64RegisterBankInfo.h"
|
2018-11-27 05:47:28 +08:00
|
|
|
#include "AArch64TargetMachine.h"
|
|
|
|
#include "MCTargetDesc/AArch64AddressingModes.h"
|
2017-05-02 05:53:19 +08:00
|
|
|
#include "llvm/CodeGen/GlobalISel/InstructionSelect.h"
|
2014-03-29 18:18:08 +08:00
|
|
|
#include "llvm/CodeGen/MachineScheduler.h"
|
|
|
|
#include "llvm/IR/GlobalValue.h"
|
2018-04-05 05:55:44 +08:00
|
|
|
#include "llvm/Support/TargetParser.h"
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2014-04-22 10:03:14 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
#define DEBUG_TYPE "aarch64-subtarget"
|
2014-04-22 06:55:11 +08:00
|
|
|
|
2014-03-29 18:18:08 +08:00
|
|
|
#define GET_SUBTARGETINFO_CTOR
|
|
|
|
#define GET_SUBTARGETINFO_TARGET_DESC
|
2014-05-24 20:50:23 +08:00
|
|
|
#include "AArch64GenSubtargetInfo.inc"
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2014-05-22 07:40:26 +08:00
|
|
|
static cl::opt<bool>
|
2014-05-24 20:50:23 +08:00
|
|
|
EnableEarlyIfConvert("aarch64-early-ifcvt", cl::desc("Enable the early if "
|
2014-05-22 07:40:26 +08:00
|
|
|
"converter pass"), cl::init(true), cl::Hidden);
|
|
|
|
|
2015-11-10 08:44:23 +08:00
|
|
|
// If OS supports TBI, use this flag to enable it.
|
|
|
|
static cl::opt<bool>
|
|
|
|
UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of "
|
|
|
|
"an address is ignored"), cl::init(false), cl::Hidden);
|
|
|
|
|
2017-04-18 02:18:47 +08:00
|
|
|
static cl::opt<bool>
|
|
|
|
UseNonLazyBind("aarch64-enable-nonlazybind",
|
|
|
|
cl::desc("Call nonlazybind functions via direct GOT load"),
|
|
|
|
cl::init(false), cl::Hidden);
|
|
|
|
|
2014-06-11 08:46:34 +08:00
|
|
|
AArch64Subtarget &
|
2016-10-04 04:17:02 +08:00
|
|
|
AArch64Subtarget::initializeSubtargetDependencies(StringRef FS,
|
|
|
|
StringRef CPUString) {
|
2014-06-11 08:46:34 +08:00
|
|
|
// Determine default and user-specified characteristics
|
|
|
|
|
|
|
|
if (CPUString.empty())
|
|
|
|
CPUString = "generic";
|
|
|
|
|
|
|
|
ParseSubtargetFeatures(CPUString, FS);
|
2016-06-03 02:03:53 +08:00
|
|
|
initializeProperties();
|
|
|
|
|
2014-06-11 08:46:34 +08:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-06-03 02:03:53 +08:00
|
|
|
void AArch64Subtarget::initializeProperties() {
|
|
|
|
// Initialize CPU specific properties. We should add a tablegen feature for
|
|
|
|
// this in the future so we can specify it together with the subtarget
|
|
|
|
// features.
|
|
|
|
switch (ARMProcFamily) {
|
2018-11-01 05:56:49 +08:00
|
|
|
case Others:
|
|
|
|
break;
|
|
|
|
case CortexA35:
|
|
|
|
break;
|
|
|
|
case CortexA53:
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 3;
|
2018-11-01 05:56:49 +08:00
|
|
|
break;
|
|
|
|
case CortexA55:
|
|
|
|
break;
|
|
|
|
case CortexA57:
|
|
|
|
MaxInterleaveFactor = 4;
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 4;
|
2018-11-01 05:56:49 +08:00
|
|
|
break;
|
[ARM][AArch64] Support for Cortex-A65 & A65AE, Neoverse E1 & N1
Summary:
Add support for Cortex-A65, Cortex-A65AE, Neoverse E1 and Neoverse N1.
Neoverse E1 and Cortex-A65(&AE) only implement the AArch64 state of the
Arm architecture. Neoverse N1 implements both AArch32 and AArch64.
Cortex-A65:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65
Cortex-A65AE:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65ae
Neoverse E1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-e1
Neoverse N1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-n1
Patch by Diogo Sampaio and Pablo Barrio
Reviewers: samparker, LukeCheeseman, sbaranga, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64406
llvm-svn: 367007
2019-07-25 18:59:45 +08:00
|
|
|
case CortexA65:
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 3;
|
[ARM][AArch64] Support for Cortex-A65 & A65AE, Neoverse E1 & N1
Summary:
Add support for Cortex-A65, Cortex-A65AE, Neoverse E1 and Neoverse N1.
Neoverse E1 and Cortex-A65(&AE) only implement the AArch64 state of the
Arm architecture. Neoverse N1 implements both AArch32 and AArch64.
Cortex-A65:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65
Cortex-A65AE:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65ae
Neoverse E1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-e1
Neoverse N1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-n1
Patch by Diogo Sampaio and Pablo Barrio
Reviewers: samparker, LukeCheeseman, sbaranga, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64406
llvm-svn: 367007
2019-07-25 18:59:45 +08:00
|
|
|
break;
|
2018-11-01 05:56:49 +08:00
|
|
|
case CortexA72:
|
|
|
|
case CortexA73:
|
|
|
|
case CortexA75:
|
2019-02-25 23:08:27 +08:00
|
|
|
case CortexA76:
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 4;
|
2018-11-01 05:56:49 +08:00
|
|
|
break;
|
2020-03-03 20:52:27 +08:00
|
|
|
case A64FX:
|
|
|
|
CacheLineSize = 256;
|
|
|
|
PrefFunctionLogAlignment = 5;
|
|
|
|
PrefLoopLogAlignment = 5;
|
|
|
|
break;
|
2019-11-15 20:39:56 +08:00
|
|
|
case AppleA7:
|
|
|
|
case AppleA10:
|
|
|
|
case AppleA11:
|
|
|
|
case AppleA12:
|
|
|
|
case AppleA13:
|
2016-06-03 02:03:53 +08:00
|
|
|
CacheLineSize = 64;
|
|
|
|
PrefetchDistance = 280;
|
|
|
|
MinPrefetchStride = 2048;
|
|
|
|
MaxPrefetchIterationsAhead = 3;
|
|
|
|
break;
|
2018-01-30 23:40:16 +08:00
|
|
|
case ExynosM3:
|
|
|
|
MaxInterleaveFactor = 4;
|
Revert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"
This caused severe compile-time regressions, see PR43455.
> Modern processors predict the targets of an indirect branch regardless of
> the size of any jump table used to glean its target address. Moreover,
> branch predictors typically use resources limited by the number of actual
> targets that occur at run time.
>
> This patch changes the semantics of the option `-max-jump-table-size` to limit
> the number of different targets instead of the number of entries in a jump
> table. Thus, it is now renamed to `-max-jump-table-targets`.
>
> Before, when `-max-jump-table-size` was specified, it could happen that
> cluster jump tables could have targets used repeatedly, but each one was
> counted and typically resulted in tables with the same number of entries.
> With this patch, when specifying `-max-jump-table-targets`, tables may have
> different lengths, since the number of unique targets is counted towards the
> limit, but the number of unique targets in tables is the same, but for the
> last one containing the balance of targets.
>
> Differential revision: https://reviews.llvm.org/D60295
llvm-svn: 373060
2019-09-27 17:54:26 +08:00
|
|
|
MaxJumpTableSize = 20;
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 5;
|
|
|
|
PrefLoopLogAlignment = 4;
|
2018-01-30 23:40:16 +08:00
|
|
|
break;
|
2016-11-22 22:25:02 +08:00
|
|
|
case Falkor:
|
|
|
|
MaxInterleaveFactor = 4;
|
2017-05-16 05:15:01 +08:00
|
|
|
// FIXME: remove this to enable 64-bit SLP if performance looks good.
|
|
|
|
MinVectorRegisterBitWidth = 128;
|
2017-06-13 00:34:19 +08:00
|
|
|
CacheLineSize = 128;
|
|
|
|
PrefetchDistance = 820;
|
|
|
|
MinPrefetchStride = 2048;
|
|
|
|
MaxPrefetchIterationsAhead = 8;
|
2016-11-22 22:25:02 +08:00
|
|
|
break;
|
2016-06-03 02:03:53 +08:00
|
|
|
case Kryo:
|
|
|
|
MaxInterleaveFactor = 4;
|
|
|
|
VectorInsertExtractBaseCost = 2;
|
2016-06-22 06:47:56 +08:00
|
|
|
CacheLineSize = 128;
|
|
|
|
PrefetchDistance = 740;
|
|
|
|
MinPrefetchStride = 1024;
|
|
|
|
MaxPrefetchIterationsAhead = 11;
|
2017-05-16 05:15:01 +08:00
|
|
|
// FIXME: remove this to enable 64-bit SLP if performance looks good.
|
|
|
|
MinVectorRegisterBitWidth = 128;
|
2016-06-03 02:03:53 +08:00
|
|
|
break;
|
[ARM][AArch64] Support for Cortex-A65 & A65AE, Neoverse E1 & N1
Summary:
Add support for Cortex-A65, Cortex-A65AE, Neoverse E1 and Neoverse N1.
Neoverse E1 and Cortex-A65(&AE) only implement the AArch64 state of the
Arm architecture. Neoverse N1 implements both AArch32 and AArch64.
Cortex-A65:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65
Cortex-A65AE:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65ae
Neoverse E1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-e1
Neoverse N1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-n1
Patch by Diogo Sampaio and Pablo Barrio
Reviewers: samparker, LukeCheeseman, sbaranga, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64406
llvm-svn: 367007
2019-07-25 18:59:45 +08:00
|
|
|
case NeoverseE1:
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 3;
|
2019-08-06 01:38:58 +08:00
|
|
|
break;
|
[ARM][AArch64] Support for Cortex-A65 & A65AE, Neoverse E1 & N1
Summary:
Add support for Cortex-A65, Cortex-A65AE, Neoverse E1 and Neoverse N1.
Neoverse E1 and Cortex-A65(&AE) only implement the AArch64 state of the
Arm architecture. Neoverse N1 implements both AArch32 and AArch64.
Cortex-A65:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65
Cortex-A65AE:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65ae
Neoverse E1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-e1
Neoverse N1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-n1
Patch by Diogo Sampaio and Pablo Barrio
Reviewers: samparker, LukeCheeseman, sbaranga, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64406
llvm-svn: 367007
2019-07-25 18:59:45 +08:00
|
|
|
case NeoverseN1:
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 4;
|
[ARM][AArch64] Support for Cortex-A65 & A65AE, Neoverse E1 & N1
Summary:
Add support for Cortex-A65, Cortex-A65AE, Neoverse E1 and Neoverse N1.
Neoverse E1 and Cortex-A65(&AE) only implement the AArch64 state of the
Arm architecture. Neoverse N1 implements both AArch32 and AArch64.
Cortex-A65:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65
Cortex-A65AE:
https://developer.arm.com/ip-products/processors/cortex-a/cortex-a65ae
Neoverse E1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-e1
Neoverse N1:
https://developer.arm.com/ip-products/processors/neoverse/neoverse-n1
Patch by Diogo Sampaio and Pablo Barrio
Reviewers: samparker, LukeCheeseman, sbaranga, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64406
llvm-svn: 367007
2019-07-25 18:59:45 +08:00
|
|
|
break;
|
2018-11-01 05:56:49 +08:00
|
|
|
case Saphira:
|
|
|
|
MaxInterleaveFactor = 4;
|
|
|
|
// FIXME: remove this to enable 64-bit SLP if performance looks good.
|
|
|
|
MinVectorRegisterBitWidth = 128;
|
|
|
|
break;
|
2017-03-08 03:42:40 +08:00
|
|
|
case ThunderX2T99:
|
|
|
|
CacheLineSize = 64;
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 3;
|
|
|
|
PrefLoopLogAlignment = 2;
|
2016-06-30 14:42:31 +08:00
|
|
|
MaxInterleaveFactor = 4;
|
2017-03-08 03:42:40 +08:00
|
|
|
PrefetchDistance = 128;
|
|
|
|
MinPrefetchStride = 1024;
|
|
|
|
MaxPrefetchIterationsAhead = 4;
|
2017-05-16 05:15:01 +08:00
|
|
|
// FIXME: remove this to enable 64-bit SLP if performance looks good.
|
|
|
|
MinVectorRegisterBitWidth = 128;
|
2016-06-30 14:42:31 +08:00
|
|
|
break;
|
2017-02-18 02:34:24 +08:00
|
|
|
case ThunderX:
|
|
|
|
case ThunderXT88:
|
|
|
|
case ThunderXT81:
|
|
|
|
case ThunderXT83:
|
|
|
|
CacheLineSize = 128;
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 3;
|
|
|
|
PrefLoopLogAlignment = 2;
|
2017-05-16 05:15:01 +08:00
|
|
|
// FIXME: remove this to enable 64-bit SLP if performance looks good.
|
|
|
|
MinVectorRegisterBitWidth = 128;
|
2017-02-18 02:34:24 +08:00
|
|
|
break;
|
2018-11-10 03:32:08 +08:00
|
|
|
case TSV110:
|
|
|
|
CacheLineSize = 64;
|
[LLVM][Alignment] Make functions using log of alignment explicit
Summary:
This patch renames functions that takes or returns alignment as log2, this patch will help with the transition to llvm::Align.
The renaming makes it explicit that we deal with log(alignment) instead of a power of two alignment.
A few renames uncovered dubious assignments:
- `MirParser`/`MirPrinter` was expecting powers of two but `MachineFunction` and `MachineBasicBlock` were using deal with log2(align). This patch fixes it and updates the documentation.
- `MachineBlockPlacement` exposes two flags (`align-all-blocks` and `align-all-nofallthru-blocks`) supposedly interpreted as power of two alignments, internally these values are interpreted as log2(align). This patch updates the documentation,
- `MachineFunctionexposes` exposes `align-all-functions` also interpreted as power of two alignment, internally this value is interpreted as log2(align). This patch updates the documentation,
Reviewers: lattner, thegameg, courbet
Subscribers: dschuff, arsenm, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, Jim, s.egerton, llvm-commits, courbet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65945
llvm-svn: 371045
2019-09-05 18:00:22 +08:00
|
|
|
PrefFunctionLogAlignment = 4;
|
|
|
|
PrefLoopLogAlignment = 2;
|
2018-11-10 03:32:08 +08:00
|
|
|
break;
|
2016-06-03 02:03:53 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-10 20:11:26 +08:00
|
|
|
AArch64Subtarget::AArch64Subtarget(const Triple &TT, const std::string &CPU,
|
2014-10-03 08:42:41 +08:00
|
|
|
const std::string &FS,
|
2017-05-19 19:08:33 +08:00
|
|
|
const TargetMachine &TM, bool LittleEndian)
|
2017-07-19 04:41:33 +08:00
|
|
|
: AArch64GenSubtargetInfo(TT, CPU, FS),
|
[AArch64] Support reserving x1-7 registers.
Summary:
Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7.
Reviewers: javed.absar, phosek, srhines, nickdesaulniers, efriedma
Reviewed By: nickdesaulniers, efriedma
Subscribers: niravd, jfb, manojgupta, nickdesaulniers, jyknight, efriedma, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D48580
llvm-svn: 341706
2018-09-08 04:58:57 +08:00
|
|
|
ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()),
|
2018-09-23 06:17:50 +08:00
|
|
|
CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()),
|
[AArch64] Support reserving x1-7 registers.
Summary:
Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7.
Reviewers: javed.absar, phosek, srhines, nickdesaulniers, efriedma
Reviewed By: nickdesaulniers, efriedma
Subscribers: niravd, jfb, manojgupta, nickdesaulniers, jyknight, efriedma, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D48580
llvm-svn: 341706
2018-09-08 04:58:57 +08:00
|
|
|
IsLittle(LittleEndian),
|
2018-04-05 05:55:44 +08:00
|
|
|
TargetTriple(TT), FrameLowering(),
|
2016-10-04 04:17:02 +08:00
|
|
|
InstrInfo(initializeSubtargetDependencies(FS, CPU)), TSInfo(),
|
2017-08-16 06:31:51 +08:00
|
|
|
TLInfo(TM, *this) {
|
[AArch64] Support reserving x1-7 registers.
Summary:
Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7.
Reviewers: javed.absar, phosek, srhines, nickdesaulniers, efriedma
Reviewed By: nickdesaulniers, efriedma
Subscribers: niravd, jfb, manojgupta, nickdesaulniers, jyknight, efriedma, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D48580
llvm-svn: 341706
2018-09-08 04:58:57 +08:00
|
|
|
if (AArch64::isX18ReservedByDefault(TT))
|
|
|
|
ReserveXRegister.set(18);
|
|
|
|
|
2017-08-16 06:31:51 +08:00
|
|
|
CallLoweringInfo.reset(new AArch64CallLowering(*getTargetLowering()));
|
2017-11-29 04:21:15 +08:00
|
|
|
Legalizer.reset(new AArch64LegalizerInfo(*this));
|
2017-05-02 05:53:19 +08:00
|
|
|
|
|
|
|
auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo());
|
|
|
|
|
|
|
|
// FIXME: At this point, we can't rely on Subtarget having RBI.
|
|
|
|
// It's awkward to mix passing RBI and the Subtarget; should we pass
|
|
|
|
// TII/TRI as well?
|
2017-08-16 06:31:51 +08:00
|
|
|
InstSelector.reset(createAArch64InstructionSelector(
|
2017-05-02 05:53:19 +08:00
|
|
|
*static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI));
|
|
|
|
|
2017-08-16 06:31:51 +08:00
|
|
|
RegBankInfo.reset(RBI);
|
2017-05-02 05:53:19 +08:00
|
|
|
}
|
2016-02-17 03:26:02 +08:00
|
|
|
|
|
|
|
const CallLowering *AArch64Subtarget::getCallLowering() const {
|
2017-08-16 06:31:51 +08:00
|
|
|
return CallLoweringInfo.get();
|
2016-04-07 01:26:03 +08:00
|
|
|
}
|
|
|
|
|
2019-08-13 14:26:59 +08:00
|
|
|
InstructionSelector *AArch64Subtarget::getInstructionSelector() const {
|
2017-08-16 06:31:51 +08:00
|
|
|
return InstSelector.get();
|
2016-07-27 22:31:55 +08:00
|
|
|
}
|
|
|
|
|
2016-10-15 06:18:18 +08:00
|
|
|
const LegalizerInfo *AArch64Subtarget::getLegalizerInfo() const {
|
2017-08-16 06:31:51 +08:00
|
|
|
return Legalizer.get();
|
2016-07-23 04:03:43 +08:00
|
|
|
}
|
|
|
|
|
2016-04-07 01:26:03 +08:00
|
|
|
const RegisterBankInfo *AArch64Subtarget::getRegBankInfo() const {
|
2017-08-16 06:31:51 +08:00
|
|
|
return RegBankInfo.get();
|
2016-02-17 03:26:02 +08:00
|
|
|
}
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2016-05-26 06:44:06 +08:00
|
|
|
/// Find the target operand flags that describe how a global value should be
|
|
|
|
/// referenced for the current subtarget.
|
2019-08-01 04:14:09 +08:00
|
|
|
unsigned
|
2014-05-24 20:50:23 +08:00
|
|
|
AArch64Subtarget::ClassifyGlobalReference(const GlobalValue *GV,
|
2016-05-26 06:44:06 +08:00
|
|
|
const TargetMachine &TM) const {
|
2014-04-02 22:39:11 +08:00
|
|
|
// MachO large model always goes via a GOT, simply to get a single 8-byte
|
|
|
|
// absolute relocation on all global addresses.
|
|
|
|
if (TM.getCodeModel() == CodeModel::Large && isTargetMachO())
|
2014-05-24 20:50:23 +08:00
|
|
|
return AArch64II::MO_GOT;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2018-09-05 04:56:28 +08:00
|
|
|
if (!TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) {
|
|
|
|
if (GV->hasDLLImportStorageClass())
|
|
|
|
return AArch64II::MO_GOT | AArch64II::MO_DLLIMPORT;
|
|
|
|
if (getTargetTriple().isOSWindows())
|
|
|
|
return AArch64II::MO_GOT | AArch64II::MO_COFFSTUB;
|
|
|
|
return AArch64II::MO_GOT;
|
|
|
|
}
|
2016-05-26 20:42:55 +08:00
|
|
|
|
2017-04-05 03:51:53 +08:00
|
|
|
// The small code model's direct accesses use ADRP, which cannot
|
|
|
|
// necessarily produce the value 0 (if the code is above 4GB).
|
2018-08-22 19:31:39 +08:00
|
|
|
// Same for the tiny code model, where we have a pc relative LDR.
|
|
|
|
if ((useSmallAddressing() || TM.getCodeModel() == CodeModel::Tiny) &&
|
|
|
|
GV->hasExternalWeakLinkage())
|
2018-09-05 04:56:28 +08:00
|
|
|
return AArch64II::MO_GOT;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2019-08-01 04:14:19 +08:00
|
|
|
// References to tagged globals are marked with MO_NC | MO_TAGGED to indicate
|
|
|
|
// that their nominal addresses are tagged and outside of the code model. In
|
|
|
|
// AArch64ExpandPseudo::expandMI we emit an additional instruction to set the
|
|
|
|
// tag if necessary based on MO_TAGGED.
|
|
|
|
if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType()))
|
|
|
|
return AArch64II::MO_NC | AArch64II::MO_TAGGED;
|
|
|
|
|
2018-09-05 04:56:28 +08:00
|
|
|
return AArch64II::MO_NO_FLAG;
|
2014-03-29 18:18:08 +08:00
|
|
|
}
|
|
|
|
|
2019-08-01 04:14:09 +08:00
|
|
|
unsigned AArch64Subtarget::classifyGlobalFunctionReference(
|
2017-04-18 01:27:56 +08:00
|
|
|
const GlobalValue *GV, const TargetMachine &TM) const {
|
|
|
|
// MachO large model always goes via a GOT, because we don't have the
|
|
|
|
// relocations available to do anything else..
|
|
|
|
if (TM.getCodeModel() == CodeModel::Large && isTargetMachO() &&
|
|
|
|
!GV->hasInternalLinkage())
|
|
|
|
return AArch64II::MO_GOT;
|
|
|
|
|
|
|
|
// NonLazyBind goes via GOT unless we know it's available locally.
|
|
|
|
auto *F = dyn_cast<Function>(GV);
|
2017-04-18 02:18:47 +08:00
|
|
|
if (UseNonLazyBind && F && F->hasFnAttribute(Attribute::NonLazyBind) &&
|
2017-04-18 01:27:56 +08:00
|
|
|
!TM.shouldAssumeDSOLocal(*GV->getParent(), GV))
|
|
|
|
return AArch64II::MO_GOT;
|
|
|
|
|
2019-12-19 20:00:44 +08:00
|
|
|
// Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB.
|
|
|
|
if (getTargetTriple().isOSWindows())
|
|
|
|
return ClassifyGlobalReference(GV, TM);
|
|
|
|
|
2017-04-18 01:27:56 +08:00
|
|
|
return AArch64II::MO_NO_FLAG;
|
|
|
|
}
|
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
void AArch64Subtarget::overrideSchedPolicy(MachineSchedPolicy &Policy,
|
2016-07-01 08:23:27 +08:00
|
|
|
unsigned NumRegionInstrs) const {
|
2014-03-29 18:18:08 +08:00
|
|
|
// LNT run (at least on Cyclone) showed reasonably significant gains for
|
|
|
|
// bi-directional scheduling. 253.perlbmk.
|
|
|
|
Policy.OnlyTopDown = false;
|
|
|
|
Policy.OnlyBottomUp = false;
|
2015-10-23 02:07:38 +08:00
|
|
|
// Enabling or Disabling the latency heuristic is a close call: It seems to
|
|
|
|
// help nearly no benchmark on out-of-order architectures, on the other hand
|
|
|
|
// it regresses register pressure on a few benchmarking.
|
2016-06-03 02:03:53 +08:00
|
|
|
Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic;
|
2014-03-29 18:18:08 +08:00
|
|
|
}
|
2014-05-22 07:40:26 +08:00
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
bool AArch64Subtarget::enableEarlyIfConversion() const {
|
2014-05-22 07:40:26 +08:00
|
|
|
return EnableEarlyIfConvert;
|
|
|
|
}
|
2014-10-10 02:20:51 +08:00
|
|
|
|
2015-11-10 08:44:23 +08:00
|
|
|
bool AArch64Subtarget::supportsAddressTopByteIgnored() const {
|
|
|
|
if (!UseAddressTopByteIgnored)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (TargetTriple.isiOS()) {
|
|
|
|
unsigned Major, Minor, Micro;
|
|
|
|
TargetTriple.getiOSVersion(Major, Minor, Micro);
|
|
|
|
return Major >= 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-10-10 02:20:51 +08:00
|
|
|
std::unique_ptr<PBQPRAConstraint>
|
|
|
|
AArch64Subtarget::getCustomPBQPConstraints() const {
|
2019-08-15 23:54:37 +08:00
|
|
|
return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
|
2014-10-10 02:20:51 +08:00
|
|
|
}
|
2018-01-19 11:16:36 +08:00
|
|
|
|
|
|
|
void AArch64Subtarget::mirFileLoaded(MachineFunction &MF) const {
|
|
|
|
// We usually compute max call frame size after ISel. Do the computation now
|
|
|
|
// if the .mir file didn't specify it. Note that this will probably give you
|
|
|
|
// bogus values after PEI has eliminated the callframe setup/destroy pseudo
|
2018-09-19 19:26:20 +08:00
|
|
|
// instructions, specify explicitly if you need it to be correct.
|
2018-01-19 11:16:36 +08:00
|
|
|
MachineFrameInfo &MFI = MF.getFrameInfo();
|
|
|
|
if (!MFI.isMaxCallFrameSizeComputed())
|
|
|
|
MFI.computeMaxCallFrameSize(MF);
|
|
|
|
}
|