Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 0906927

Browse files
author
Chad Rosier
committed
[AArch64] Enable merging of adjacent zero stores for all subtargets.
This optimization merges adjacent zero stores into a wider store. e.g., strh wzr, [x0] strh wzr, [x0, #2] ; becomes str wzr, [x0] e.g., str wzr, [x0] str wzr, [x0, #4] ; becomes str xzr, [x0] Previously, this was only enabled for Kryo and Cortex-A57. Differential Revision: https://reviews.llvm.org/D26396 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286592 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 45849f5 commit 0906927

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

lib/Target/AArch64/AArch64.td

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ def FeatureReserveX18 : SubtargetFeature<"reserve-x18", "ReserveX18", "true",
6161
"Reserve X18, making it unavailable "
6262
"as a GPR">;
6363

64-
def FeatureMergeNarrowZeroSt : SubtargetFeature<"merge-narrow-zero-st",
65-
"MergeNarrowZeroStores", "true",
66-
"Merge narrow zero store "
67-
"instructions">;
68-
6964
def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
7065
"Use alias analysis during codegen">;
7166

@@ -182,7 +177,6 @@ def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
182177
FeatureCrypto,
183178
FeatureCustomCheapAsMoveHandling,
184179
FeatureFPARMv8,
185-
FeatureMergeNarrowZeroSt,
186180
FeatureNEON,
187181
FeaturePerfMon,
188182
FeaturePostRAScheduler,
@@ -253,7 +247,6 @@ def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
253247
FeatureCrypto,
254248
FeatureCustomCheapAsMoveHandling,
255249
FeatureFPARMv8,
256-
FeatureMergeNarrowZeroSt,
257250
FeatureNEON,
258251
FeaturePerfMon,
259252
FeaturePostRAScheduler,

lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,8 +1699,7 @@ bool AArch64LoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
16991699
UsedRegs.resize(TRI->getNumRegs());
17001700

17011701
bool Modified = false;
1702-
bool enableNarrowZeroStOpt =
1703-
Subtarget->mergeNarrowStores() && !Subtarget->requiresStrictAlign();
1702+
bool enableNarrowZeroStOpt = !Subtarget->requiresStrictAlign();
17041703
for (auto &MBB : Fn)
17051704
Modified |= optimizeBlock(MBB, enableNarrowZeroStOpt);
17061705

lib/Target/AArch64/AArch64Subtarget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
7171

7272
// StrictAlign - Disallow unaligned memory accesses.
7373
bool StrictAlign = false;
74-
bool MergeNarrowZeroStores = false;
7574
bool UseAA = false;
7675
bool PredictableSelectIsExpensive = false;
7776
bool BalanceFPOps = false;
@@ -179,7 +178,6 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
179178
bool hasCrypto() const { return HasCrypto; }
180179
bool hasCRC() const { return HasCRC; }
181180
bool hasRAS() const { return HasRAS; }
182-
bool mergeNarrowStores() const { return MergeNarrowZeroStores; }
183181
bool balanceFPOps() const { return BalanceFPOps; }
184182
bool predictableSelectIsExpensive() const {
185183
return PredictableSelectIsExpensive;

test/CodeGen/AArch64/arm64-narrow-st-merge.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
; RUN: llc < %s -mtriple aarch64--none-eabi -mcpu=cortex-a57 -verify-machineinstrs | FileCheck %s
2-
; RUN: llc < %s -mtriple aarch64_be--none-eabi -mcpu=cortex-a57 -verify-machineinstrs | FileCheck %s
3-
; RUN: llc < %s -mtriple aarch64--none-eabi -mcpu=kryo -verify-machineinstrs | FileCheck %s
1+
; RUN: llc < %s -mtriple aarch64--none-eabi -verify-machineinstrs | FileCheck %s
42

53
; CHECK-LABEL: Strh_zero
64
; CHECK: str wzr

0 commit comments

Comments
 (0)