Second land attempt. MachineVerifier DefRegState expensive check errors fixed.
Prologs and epilogs handle callee-save registers and tend to be irregular with
different immediate offsets that are not often handled by the MachineOutliner.
Commit D18619/a5335647d5e8 (combining stack operations) stretched irregularity
further.
This patch tries to emit homogeneous stores and loads with the same offset for
prologs and epilogs respectively. We have observed that this canonicalizes
(homogenizes) prologs and epilogs significantly and results in a greatly
increased chance of outlining, resulting in a code size reduction.
Despite the above results, there are still size wins to be had that the
MachineOutliner does not provide due to the special handling X30/LR. To handle
the LR case, his patch custom-outlines prologs and epilogs in place. It does
this by doing the following:
* Injects HOM_Prolog and HOM_Epilog pseudo instructions during a Prolog and
Epilog Injection Pass.
* Lowers and optimizes said pseudos in a AArchLowerHomogneousPrologEpilog Pass.
* Outlined helpers are created on demand. Identical helpers are merged by the linker.
* An opt-in flag is introduced to enable this feature. Another threshold flag
is also introduced to control the aggressiveness of outlining for application's need.
This reduced an average of 4% of code size on LLVM-TestSuite/CTMark targeting arm64/-Oz.
Differential Revision: https://reviews.llvm.org/D76570
101 lines
4.4 KiB
C++
101 lines
4.4 KiB
C++
//==-- AArch64.h - Top-level interface for AArch64 --------------*- C++ -*-==//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains the entry points for global functions defined in the LLVM
|
|
// AArch64 back-end.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64_H
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64_H
|
|
|
|
#include "MCTargetDesc/AArch64MCTargetDesc.h"
|
|
#include "Utils/AArch64BaseInfo.h"
|
|
#include "llvm/Support/DataTypes.h"
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
namespace llvm {
|
|
|
|
class AArch64RegisterBankInfo;
|
|
class AArch64Subtarget;
|
|
class AArch64TargetMachine;
|
|
class FunctionPass;
|
|
class InstructionSelector;
|
|
class MachineFunctionPass;
|
|
|
|
FunctionPass *createAArch64DeadRegisterDefinitions();
|
|
FunctionPass *createAArch64RedundantCopyEliminationPass();
|
|
FunctionPass *createAArch64CondBrTuning();
|
|
FunctionPass *createAArch64CompressJumpTablesPass();
|
|
FunctionPass *createAArch64ConditionalCompares();
|
|
FunctionPass *createAArch64AdvSIMDScalar();
|
|
FunctionPass *createAArch64ISelDag(AArch64TargetMachine &TM,
|
|
CodeGenOpt::Level OptLevel);
|
|
FunctionPass *createAArch64StorePairSuppressPass();
|
|
FunctionPass *createAArch64ExpandPseudoPass();
|
|
FunctionPass *createAArch64SLSHardeningPass();
|
|
FunctionPass *createAArch64IndirectThunks();
|
|
FunctionPass *createAArch64SpeculationHardeningPass();
|
|
FunctionPass *createAArch64LoadStoreOptimizationPass();
|
|
ModulePass *createAArch64LowerHomogeneousPrologEpilogPass();
|
|
FunctionPass *createAArch64SIMDInstrOptPass();
|
|
ModulePass *createAArch64PromoteConstantPass();
|
|
FunctionPass *createAArch64ConditionOptimizerPass();
|
|
FunctionPass *createAArch64A57FPLoadBalancing();
|
|
FunctionPass *createAArch64A53Fix835769();
|
|
FunctionPass *createFalkorHWPFFixPass();
|
|
FunctionPass *createFalkorMarkStridedAccessesPass();
|
|
FunctionPass *createAArch64BranchTargetsPass();
|
|
|
|
FunctionPass *createAArch64CleanupLocalDynamicTLSPass();
|
|
|
|
FunctionPass *createAArch64CollectLOHPass();
|
|
ModulePass *createSVEIntrinsicOptsPass();
|
|
InstructionSelector *
|
|
createAArch64InstructionSelector(const AArch64TargetMachine &,
|
|
AArch64Subtarget &, AArch64RegisterBankInfo &);
|
|
FunctionPass *createAArch64PreLegalizerCombiner(bool IsOptNone);
|
|
FunctionPass *createAArch64PostLegalizerCombiner(bool IsOptNone);
|
|
FunctionPass *createAArch64PostLegalizerLowering();
|
|
FunctionPass *createAArch64PostSelectOptimize();
|
|
FunctionPass *createAArch64StackTaggingPass(bool IsOptNone);
|
|
FunctionPass *createAArch64StackTaggingPreRAPass();
|
|
|
|
void initializeAArch64A53Fix835769Pass(PassRegistry&);
|
|
void initializeAArch64A57FPLoadBalancingPass(PassRegistry&);
|
|
void initializeAArch64AdvSIMDScalarPass(PassRegistry&);
|
|
void initializeAArch64BranchTargetsPass(PassRegistry&);
|
|
void initializeAArch64CollectLOHPass(PassRegistry&);
|
|
void initializeAArch64CondBrTuningPass(PassRegistry &);
|
|
void initializeAArch64CompressJumpTablesPass(PassRegistry&);
|
|
void initializeAArch64ConditionalComparesPass(PassRegistry&);
|
|
void initializeAArch64ConditionOptimizerPass(PassRegistry&);
|
|
void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry&);
|
|
void initializeAArch64ExpandPseudoPass(PassRegistry&);
|
|
void initializeAArch64SLSHardeningPass(PassRegistry&);
|
|
void initializeAArch64SpeculationHardeningPass(PassRegistry&);
|
|
void initializeAArch64LoadStoreOptPass(PassRegistry&);
|
|
void initializeAArch64LowerHomogeneousPrologEpilogPass(PassRegistry &);
|
|
void initializeAArch64SIMDInstrOptPass(PassRegistry&);
|
|
void initializeAArch64PreLegalizerCombinerPass(PassRegistry&);
|
|
void initializeAArch64PostLegalizerCombinerPass(PassRegistry &);
|
|
void initializeAArch64PostLegalizerLoweringPass(PassRegistry &);
|
|
void initializeAArch64PostSelectOptimizePass(PassRegistry &);
|
|
void initializeAArch64PromoteConstantPass(PassRegistry&);
|
|
void initializeAArch64RedundantCopyEliminationPass(PassRegistry&);
|
|
void initializeAArch64StorePairSuppressPass(PassRegistry&);
|
|
void initializeFalkorHWPFFixPass(PassRegistry&);
|
|
void initializeFalkorMarkStridedAccessesLegacyPass(PassRegistry&);
|
|
void initializeLDTLSCleanupPass(PassRegistry&);
|
|
void initializeSVEIntrinsicOptsPass(PassRegistry&);
|
|
void initializeAArch64StackTaggingPass(PassRegistry&);
|
|
void initializeAArch64StackTaggingPreRAPass(PassRegistry&);
|
|
} // end namespace llvm
|
|
|
|
#endif
|