2014-05-24 20:50:23 +08:00
|
|
|
//==-- AArch64.h - Top-level interface for AArch64 --------------*- C++ -*-==//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the entry points for global functions defined in the LLVM
|
|
|
|
// AArch64 back-end.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64_H
|
|
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64_H
|
2014-05-24 20:50:23 +08:00
|
|
|
|
|
|
|
#include "MCTargetDesc/AArch64MCTargetDesc.h"
|
2014-07-25 19:42:14 +08:00
|
|
|
#include "Utils/AArch64BaseInfo.h"
|
2014-05-24 20:50:23 +08:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
2014-07-25 19:42:14 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2014-05-24 20:50:23 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2017-04-06 17:49:34 +08:00
|
|
|
class AArch64RegisterBankInfo;
|
|
|
|
class AArch64Subtarget;
|
2014-05-24 20:50:23 +08:00
|
|
|
class AArch64TargetMachine;
|
|
|
|
class FunctionPass;
|
2017-04-06 17:49:34 +08:00
|
|
|
class InstructionSelector;
|
2014-05-24 20:50:23 +08:00
|
|
|
class MachineFunctionPass;
|
|
|
|
|
|
|
|
FunctionPass *createAArch64DeadRegisterDefinitions();
|
[AArch64] Add pass to remove redundant copy after RA
Summary:
This change will add a pass to remove unnecessary zero copies in target blocks
of cbz/cbnz instructions. E.g., the copy instruction in the code below can be
removed because the cbz jumps to BB1 when x0 is zero :
BB0:
cbz x0, .BB1
BB1:
mov x0, xzr
Jun
Reviewers: gberry, jmolloy, HaoLiu, MatzeB, mcrosier
Subscribers: mcrosier, mssimpso, haicheng, bmakam, llvm-commits, aemerson, rengolin
Differential Revision: http://reviews.llvm.org/D16203
llvm-svn: 261004
2016-02-17 04:02:39 +08:00
|
|
|
FunctionPass *createAArch64RedundantCopyEliminationPass();
|
[AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free".
This patch contains a pass that transforms CBZ/CBNZ/TBZ/TBNZ instructions into a
conditional branch (Bcc), when the NZCV flags can be set for "free". This is
preferred on targets that have more flexibility when scheduling Bcc
instructions as compared to CBZ/CBNZ/TBZ/TBNZ (assuming all other variables are
equal). This can reduce register pressure and is also the default behavior for
GCC.
A few examples:
add w8, w0, w1 -> cmn w0, w1 ; CMN is an alias of ADDS.
cbz w8, .LBB_2 -> b.eq .LBB0_2 ; single def/use of w8 removed.
add w8, w0, w1 -> adds w8, w0, w1 ; w8 has multiple uses.
cbz w8, .LBB1_2 -> b.eq .LBB1_2
sub w8, w0, w1 -> subs w8, w0, w1 ; w8 has multiple uses.
tbz w8, #31, .LBB6_2 -> b.ge .LBB6_2
In looking at all current sub-target machine descriptions, this transformation
appears to be either positive or neutral.
Differential Revision: https://reviews.llvm.org/D34220.
llvm-svn: 306144
2017-06-24 03:20:12 +08:00
|
|
|
FunctionPass *createAArch64CondBrTuning();
|
2014-05-24 20:50:23 +08:00
|
|
|
FunctionPass *createAArch64ConditionalCompares();
|
|
|
|
FunctionPass *createAArch64AdvSIMDScalar();
|
|
|
|
FunctionPass *createAArch64ISelDag(AArch64TargetMachine &TM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
|
|
|
FunctionPass *createAArch64StorePairSuppressPass();
|
|
|
|
FunctionPass *createAArch64ExpandPseudoPass();
|
|
|
|
FunctionPass *createAArch64LoadStoreOptimizationPass();
|
2017-12-08 08:58:49 +08:00
|
|
|
FunctionPass *createAArch64SIMDInstrOptPass();
|
2014-05-24 20:50:23 +08:00
|
|
|
ModulePass *createAArch64PromoteConstantPass();
|
2014-09-05 10:55:24 +08:00
|
|
|
FunctionPass *createAArch64ConditionOptimizerPass();
|
2014-08-08 20:33:21 +08:00
|
|
|
FunctionPass *createAArch64A57FPLoadBalancing();
|
2014-10-13 18:12:35 +08:00
|
|
|
FunctionPass *createAArch64A53Fix835769();
|
2017-07-19 00:14:22 +08:00
|
|
|
FunctionPass *createFalkorHWPFFixPass();
|
2017-07-15 05:44:12 +08:00
|
|
|
FunctionPass *createFalkorMarkStridedAccessesPass();
|
2014-05-24 20:50:23 +08:00
|
|
|
|
|
|
|
FunctionPass *createAArch64CleanupLocalDynamicTLSPass();
|
|
|
|
|
|
|
|
FunctionPass *createAArch64CollectLOHPass();
|
2017-04-06 17:49:34 +08:00
|
|
|
InstructionSelector *
|
|
|
|
createAArch64InstructionSelector(const AArch64TargetMachine &,
|
|
|
|
AArch64Subtarget &, AArch64RegisterBankInfo &);
|
2016-04-02 07:14:52 +08:00
|
|
|
|
2016-08-01 13:56:57 +08:00
|
|
|
void initializeAArch64A53Fix835769Pass(PassRegistry&);
|
|
|
|
void initializeAArch64A57FPLoadBalancingPass(PassRegistry&);
|
|
|
|
void initializeAArch64AdvSIMDScalarPass(PassRegistry&);
|
|
|
|
void initializeAArch64CollectLOHPass(PassRegistry&);
|
[AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free".
This patch contains a pass that transforms CBZ/CBNZ/TBZ/TBNZ instructions into a
conditional branch (Bcc), when the NZCV flags can be set for "free". This is
preferred on targets that have more flexibility when scheduling Bcc
instructions as compared to CBZ/CBNZ/TBZ/TBNZ (assuming all other variables are
equal). This can reduce register pressure and is also the default behavior for
GCC.
A few examples:
add w8, w0, w1 -> cmn w0, w1 ; CMN is an alias of ADDS.
cbz w8, .LBB_2 -> b.eq .LBB0_2 ; single def/use of w8 removed.
add w8, w0, w1 -> adds w8, w0, w1 ; w8 has multiple uses.
cbz w8, .LBB1_2 -> b.eq .LBB1_2
sub w8, w0, w1 -> subs w8, w0, w1 ; w8 has multiple uses.
tbz w8, #31, .LBB6_2 -> b.ge .LBB6_2
In looking at all current sub-target machine descriptions, this transformation
appears to be either positive or neutral.
Differential Revision: https://reviews.llvm.org/D34220.
llvm-svn: 306144
2017-06-24 03:20:12 +08:00
|
|
|
void initializeAArch64CondBrTuningPass(PassRegistry &);
|
2016-08-01 13:56:57 +08:00
|
|
|
void initializeAArch64ConditionalComparesPass(PassRegistry&);
|
|
|
|
void initializeAArch64ConditionOptimizerPass(PassRegistry&);
|
|
|
|
void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry&);
|
2016-04-02 07:14:52 +08:00
|
|
|
void initializeAArch64ExpandPseudoPass(PassRegistry&);
|
2016-07-21 05:45:58 +08:00
|
|
|
void initializeAArch64LoadStoreOptPass(PassRegistry&);
|
2017-12-08 08:58:49 +08:00
|
|
|
void initializeAArch64SIMDInstrOptPass(PassRegistry&);
|
2016-08-01 13:56:57 +08:00
|
|
|
void initializeAArch64PromoteConstantPass(PassRegistry&);
|
|
|
|
void initializeAArch64RedundantCopyEliminationPass(PassRegistry&);
|
|
|
|
void initializeAArch64StorePairSuppressPass(PassRegistry&);
|
2017-07-19 00:14:22 +08:00
|
|
|
void initializeFalkorHWPFFixPass(PassRegistry&);
|
2017-07-15 05:44:12 +08:00
|
|
|
void initializeFalkorMarkStridedAccessesLegacyPass(PassRegistry&);
|
2016-08-01 13:56:57 +08:00
|
|
|
void initializeLDTLSCleanupPass(PassRegistry&);
|
2014-05-24 20:50:23 +08:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|