2012-02-18 13:03:15 +01:00
|
|
|
//===-- HexagonTargetMachine.cpp - Define TargetMachine for Hexagon -------===//
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
2019-01-19 09:50:56 +01: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
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2012-02-18 13:03:15 +01:00
|
|
|
// Implements the info about Hexagon target spec.
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "HexagonTargetMachine.h"
|
|
|
|
#include "Hexagon.h"
|
|
|
|
#include "HexagonISelLowering.h"
|
2020-11-20 00:52:21 +01:00
|
|
|
#include "HexagonLoopIdiomRecognition.h"
|
2012-09-04 16:49:56 +02:00
|
|
|
#include "HexagonMachineScheduler.h"
|
2013-05-07 21:53:00 +02:00
|
|
|
#include "HexagonTargetObjectFile.h"
|
2015-08-05 20:35:37 +02:00
|
|
|
#include "HexagonTargetTransformInfo.h"
|
2020-09-21 22:43:42 +02:00
|
|
|
#include "HexagonVectorLoopCarriedReuse.h"
|
2019-05-15 01:04:55 +02:00
|
|
|
#include "TargetInfo/HexagonTargetInfo.h"
|
2011-12-12 22:14:40 +01:00
|
|
|
#include "llvm/CodeGen/Passes.h"
|
2016-05-10 05:21:59 +02:00
|
|
|
#include "llvm/CodeGen/TargetPassConfig.h"
|
2015-02-13 11:01:29 +01:00
|
|
|
#include "llvm/IR/LegacyPassManager.h"
|
2013-01-02 12:36:10 +01:00
|
|
|
#include "llvm/IR/Module.h"
|
2020-09-30 22:23:21 +02:00
|
|
|
#include "llvm/Passes/PassBuilder.h"
|
2012-02-06 11:19:29 +01:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2011-12-12 22:14:40 +01:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
2017-01-26 22:41:10 +01:00
|
|
|
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
2017-06-06 13:49:48 +02:00
|
|
|
#include "llvm/Transforms/Scalar.h"
|
2011-12-12 22:14:40 +01:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2017-10-13 21:02:59 +02:00
|
|
|
static cl::opt<bool> EnableCExtOpt("hexagon-cext", cl::Hidden, cl::ZeroOrMore,
|
|
|
|
cl::init(true), cl::desc("Enable Hexagon constant-extender optimization"));
|
|
|
|
|
2016-01-12 20:09:01 +01:00
|
|
|
static cl::opt<bool> EnableRDFOpt("rdf-opt", cl::Hidden, cl::ZeroOrMore,
|
|
|
|
cl::init(true), cl::desc("Enable RDF-based optimizations"));
|
|
|
|
|
|
|
|
static cl::opt<bool> DisableHardwareLoops("disable-hexagon-hwloops",
|
2015-03-31 15:35:12 +02:00
|
|
|
cl::Hidden, cl::desc("Disable Hardware Loops for Hexagon target"));
|
2011-12-12 22:14:40 +01:00
|
|
|
|
2016-04-29 17:49:13 +02:00
|
|
|
static cl::opt<bool> DisableAModeOpt("disable-hexagon-amodeopt",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("Disable Hexagon Addressing Mode Optimization"));
|
|
|
|
|
2013-03-27 12:14:24 +01:00
|
|
|
static cl::opt<bool> DisableHexagonCFGOpt("disable-hexagon-cfgopt",
|
2015-03-31 15:35:12 +02:00
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("Disable Hexagon CFG Optimization"));
|
|
|
|
|
2016-07-28 22:01:59 +02:00
|
|
|
static cl::opt<bool> DisableHCP("disable-hcp", cl::init(false), cl::Hidden,
|
|
|
|
cl::ZeroOrMore, cl::desc("Disable Hexagon constant propagation"));
|
|
|
|
|
2015-10-16 21:43:56 +02:00
|
|
|
static cl::opt<bool> DisableStoreWidening("disable-store-widen",
|
|
|
|
cl::Hidden, cl::init(false), cl::desc("Disable store widening"));
|
|
|
|
|
2015-03-31 15:35:12 +02:00
|
|
|
static cl::opt<bool> EnableExpandCondsets("hexagon-expand-condsets",
|
|
|
|
cl::init(true), cl::Hidden, cl::ZeroOrMore,
|
|
|
|
cl::desc("Early expansion of MUX"));
|
2013-05-06 23:25:45 +02:00
|
|
|
|
2015-10-06 17:49:14 +02:00
|
|
|
static cl::opt<bool> EnableEarlyIf("hexagon-eif", cl::init(true), cl::Hidden,
|
|
|
|
cl::ZeroOrMore, cl::desc("Enable early if-conversion"));
|
|
|
|
|
2015-07-08 16:47:34 +02:00
|
|
|
static cl::opt<bool> EnableGenInsert("hexagon-insert", cl::init(true),
|
|
|
|
cl::Hidden, cl::desc("Generate \"insert\" instructions"));
|
2013-03-27 12:14:24 +01:00
|
|
|
|
2015-07-08 21:22:28 +02:00
|
|
|
static cl::opt<bool> EnableCommGEP("hexagon-commgep", cl::init(true),
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::desc("Enable commoning of GEP instructions"));
|
|
|
|
|
2015-07-14 19:07:24 +02:00
|
|
|
static cl::opt<bool> EnableGenExtract("hexagon-extract", cl::init(true),
|
|
|
|
cl::Hidden, cl::desc("Generate \"extract\" instructions"));
|
2015-07-08 21:22:28 +02:00
|
|
|
|
2015-07-20 23:23:25 +02:00
|
|
|
static cl::opt<bool> EnableGenMux("hexagon-mux", cl::init(true), cl::Hidden,
|
|
|
|
cl::desc("Enable converting conditional transfers into MUX instructions"));
|
|
|
|
|
2015-07-14 21:30:21 +02:00
|
|
|
static cl::opt<bool> EnableGenPred("hexagon-gen-pred", cl::init(true),
|
|
|
|
cl::Hidden, cl::desc("Enable conversion of arithmetic operations to "
|
|
|
|
"predicate instructions"));
|
|
|
|
|
2016-07-22 16:22:43 +02:00
|
|
|
static cl::opt<bool> EnableLoopPrefetch("hexagon-loop-prefetch",
|
|
|
|
cl::init(false), cl::Hidden, cl::ZeroOrMore,
|
|
|
|
cl::desc("Enable loop data prefetch on Hexagon"));
|
|
|
|
|
2015-10-16 22:38:54 +02:00
|
|
|
static cl::opt<bool> DisableHSDR("disable-hsdr", cl::init(false), cl::Hidden,
|
|
|
|
cl::desc("Disable splitting double registers"));
|
|
|
|
|
2015-10-21 00:57:13 +02:00
|
|
|
static cl::opt<bool> EnableBitSimplify("hexagon-bit", cl::init(true),
|
|
|
|
cl::Hidden, cl::desc("Bit simplification"));
|
|
|
|
|
|
|
|
static cl::opt<bool> EnableLoopResched("hexagon-loop-resched", cl::init(true),
|
|
|
|
cl::Hidden, cl::desc("Loop rescheduling"));
|
|
|
|
|
2016-05-11 17:01:30 +02:00
|
|
|
static cl::opt<bool> HexagonNoOpt("hexagon-noopt", cl::init(false),
|
|
|
|
cl::Hidden, cl::desc("Disable backend optimizations"));
|
|
|
|
|
2016-08-01 21:36:39 +02:00
|
|
|
static cl::opt<bool> EnableVectorPrint("enable-hexagon-vector-print",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("Enable Hexagon Vector print instr pass"));
|
|
|
|
|
2018-01-26 22:17:14 +01:00
|
|
|
static cl::opt<bool> EnableVExtractOpt("hexagon-opt-vextract", cl::Hidden,
|
|
|
|
cl::ZeroOrMore, cl::init(true), cl::desc("Enable vextract optimization"));
|
|
|
|
|
2020-09-07 21:26:48 +02:00
|
|
|
static cl::opt<bool> EnableVectorCombine("hexagon-vector-combine", cl::Hidden,
|
|
|
|
cl::ZeroOrMore, cl::init(true), cl::desc("Enable HVX vector combining"));
|
|
|
|
|
2018-08-03 00:17:53 +02:00
|
|
|
static cl::opt<bool> EnableInitialCFGCleanup("hexagon-initial-cfg-cleanup",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true),
|
|
|
|
cl::desc("Simplify the CFG after atomic expansion pass"));
|
|
|
|
|
2020-07-29 22:54:07 +02:00
|
|
|
static cl::opt<bool> EnableInstSimplify("hexagon-instsimplify", cl::Hidden,
|
|
|
|
cl::ZeroOrMore, cl::init(true),
|
|
|
|
cl::desc("Enable instsimplify"));
|
|
|
|
|
2011-12-12 22:14:40 +01:00
|
|
|
/// HexagonTargetMachineModule - Note that this is used on hosts that
|
|
|
|
/// cannot link in a library unless there are references into the
|
|
|
|
/// library. In particular, it seems that it is not possible to get
|
|
|
|
/// things to work on Win32 without this. Though it is unused, do not
|
|
|
|
/// remove it.
|
|
|
|
extern "C" int HexagonTargetMachineModule;
|
|
|
|
int HexagonTargetMachineModule = 0;
|
|
|
|
|
2012-09-04 16:49:56 +02:00
|
|
|
static ScheduleDAGInstrs *createVLIWMachineSched(MachineSchedContext *C) {
|
2017-08-28 17:52:54 +02:00
|
|
|
ScheduleDAGMILive *DAG =
|
2019-08-15 17:54:37 +02:00
|
|
|
new VLIWMachineScheduler(C, std::make_unique<ConvergingVLIWScheduler>());
|
|
|
|
DAG->addMutation(std::make_unique<HexagonSubtarget::UsrOverflowMutation>());
|
|
|
|
DAG->addMutation(std::make_unique<HexagonSubtarget::HVXMemLatencyMutation>());
|
|
|
|
DAG->addMutation(std::make_unique<HexagonSubtarget::CallMutation>());
|
2017-08-28 17:52:54 +02:00
|
|
|
DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI));
|
|
|
|
return DAG;
|
2012-09-04 16:49:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static MachineSchedRegistry
|
|
|
|
SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler",
|
|
|
|
createVLIWMachineSched);
|
2011-12-12 22:14:40 +01:00
|
|
|
|
2015-03-31 15:35:12 +02:00
|
|
|
namespace llvm {
|
2016-08-25 00:27:36 +02:00
|
|
|
extern char &HexagonExpandCondsetsID;
|
2018-02-20 15:29:43 +01:00
|
|
|
void initializeHexagonBitSimplifyPass(PassRegistry&);
|
2017-10-13 21:02:59 +02:00
|
|
|
void initializeHexagonConstExtendersPass(PassRegistry&);
|
2018-02-23 21:33:26 +01:00
|
|
|
void initializeHexagonConstPropagationPass(PassRegistry&);
|
2017-08-09 23:22:05 +02:00
|
|
|
void initializeHexagonEarlyIfConversionPass(PassRegistry&);
|
2016-08-25 00:27:36 +02:00
|
|
|
void initializeHexagonExpandCondsetsPass(PassRegistry&);
|
2017-06-13 18:07:36 +02:00
|
|
|
void initializeHexagonGenMuxPass(PassRegistry&);
|
2017-10-20 18:56:33 +02:00
|
|
|
void initializeHexagonHardwareLoopsPass(PassRegistry&);
|
2020-11-20 00:52:21 +01:00
|
|
|
void initializeHexagonLoopIdiomRecognizeLegacyPassPass(PassRegistry &);
|
2017-06-27 20:37:16 +02:00
|
|
|
void initializeHexagonNewValueJumpPass(PassRegistry&);
|
2017-07-10 20:38:52 +02:00
|
|
|
void initializeHexagonOptAddrModePass(PassRegistry&);
|
|
|
|
void initializeHexagonPacketizerPass(PassRegistry&);
|
2017-10-30 15:11:52 +01:00
|
|
|
void initializeHexagonRDFOptPass(PassRegistry&);
|
2018-05-04 17:04:48 +02:00
|
|
|
void initializeHexagonSplitDoubleRegsPass(PassRegistry&);
|
2020-09-07 21:26:48 +02:00
|
|
|
void initializeHexagonVectorCombineLegacyPass(PassRegistry&);
|
|
|
|
void initializeHexagonVectorLoopCarriedReuseLegacyPassPass(PassRegistry &);
|
2018-01-26 22:17:14 +01:00
|
|
|
void initializeHexagonVExtractPass(PassRegistry&);
|
2017-01-26 22:41:10 +01:00
|
|
|
Pass *createHexagonLoopIdiomPass();
|
2020-09-21 22:43:42 +02:00
|
|
|
Pass *createHexagonVectorLoopCarriedReuseLegacyPass();
|
2016-08-25 00:27:36 +02:00
|
|
|
|
2015-10-21 00:57:13 +02:00
|
|
|
FunctionPass *createHexagonBitSimplify();
|
2016-04-19 20:30:18 +02:00
|
|
|
FunctionPass *createHexagonBranchRelaxation();
|
2015-10-19 19:46:01 +02:00
|
|
|
FunctionPass *createHexagonCallFrameInformation();
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonCFGOptimizer();
|
2015-07-08 21:22:28 +02:00
|
|
|
FunctionPass *createHexagonCommonGEP();
|
2017-10-13 21:02:59 +02:00
|
|
|
FunctionPass *createHexagonConstExtenders();
|
2016-07-28 22:01:59 +02:00
|
|
|
FunctionPass *createHexagonConstPropagationPass();
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonCopyToCombine();
|
2015-10-06 17:49:14 +02:00
|
|
|
FunctionPass *createHexagonEarlyIfConversion();
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonFixupHwLoops();
|
|
|
|
FunctionPass *createHexagonGenExtract();
|
2015-07-08 16:47:34 +02:00
|
|
|
FunctionPass *createHexagonGenInsert();
|
2015-07-20 23:23:25 +02:00
|
|
|
FunctionPass *createHexagonGenMux();
|
2015-07-14 21:30:21 +02:00
|
|
|
FunctionPass *createHexagonGenPredicate();
|
2015-06-15 21:05:35 +02:00
|
|
|
FunctionPass *createHexagonHardwareLoops();
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
2015-10-21 00:57:13 +02:00
|
|
|
FunctionPass *createHexagonLoopRescheduling();
|
2015-06-15 21:05:35 +02:00
|
|
|
FunctionPass *createHexagonNewValueJump();
|
2016-04-29 17:49:13 +02:00
|
|
|
FunctionPass *createHexagonOptAddrMode();
|
2020-09-07 21:26:48 +02:00
|
|
|
FunctionPass *createHexagonOptimizeSZextends();
|
2018-08-17 16:24:24 +02:00
|
|
|
FunctionPass *createHexagonPacketizer(bool Minimal);
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonPeephole();
|
2016-01-12 20:09:01 +01:00
|
|
|
FunctionPass *createHexagonRDFOpt();
|
2015-07-14 19:07:24 +02:00
|
|
|
FunctionPass *createHexagonSplitConst32AndConst64();
|
2015-10-16 22:38:54 +02:00
|
|
|
FunctionPass *createHexagonSplitDoubleRegs();
|
2015-10-16 21:43:56 +02:00
|
|
|
FunctionPass *createHexagonStoreWidening();
|
2020-09-07 21:26:48 +02:00
|
|
|
FunctionPass *createHexagonVectorCombineLegacyPass();
|
2016-08-01 21:36:39 +02:00
|
|
|
FunctionPass *createHexagonVectorPrint();
|
2018-01-26 22:17:14 +01:00
|
|
|
FunctionPass *createHexagonVExtract();
|
2015-06-23 11:49:53 +02:00
|
|
|
} // end namespace llvm;
|
2015-03-31 15:35:12 +02:00
|
|
|
|
2016-05-19 00:04:49 +02:00
|
|
|
static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) {
|
2021-01-13 06:43:50 +01:00
|
|
|
return RM.getValueOr(Reloc::Static);
|
2016-05-19 00:04:49 +02:00
|
|
|
}
|
2011-12-12 22:14:40 +01:00
|
|
|
|
CMake: Make most target symbols hidden by default
Summary:
For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
this change makes all symbols in the target specific libraries hidden
by default.
A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
libraries public, which is mainly needed for the definitions of the
LLVMInitialize* functions.
This patch reduces the number of public symbols in libLLVM.so by about
25%. This should improve load times for the dynamic library and also
make abi checker tools, like abidiff require less memory when analyzing
libLLVM.so
One side-effect of this change is that for builds with
LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
access symbols that are no longer public will need to be statically linked.
Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
36221
nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
26278
Reviewers: chandlerc, beanz, mgorny, rnk, hans
Reviewed By: rnk, hans
Subscribers: merge_guards_bot, luismarques, smeenai, ldionne, lenary, s.egerton, pzheng, sameer.abuasal, MaskRay, wuzish, echristo, Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D54439
2020-01-15 04:15:07 +01:00
|
|
|
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonTarget() {
|
2017-01-26 22:41:10 +01:00
|
|
|
// Register the target.
|
|
|
|
RegisterTargetMachine<HexagonTargetMachine> X(getTheHexagonTarget());
|
2017-06-13 18:07:36 +02:00
|
|
|
|
|
|
|
PassRegistry &PR = *PassRegistry::getPassRegistry();
|
2018-02-20 15:29:43 +01:00
|
|
|
initializeHexagonBitSimplifyPass(PR);
|
2017-10-13 21:02:59 +02:00
|
|
|
initializeHexagonConstExtendersPass(PR);
|
2018-02-23 21:33:26 +01:00
|
|
|
initializeHexagonConstPropagationPass(PR);
|
2017-08-09 23:22:05 +02:00
|
|
|
initializeHexagonEarlyIfConversionPass(PR);
|
2017-06-13 18:07:36 +02:00
|
|
|
initializeHexagonGenMuxPass(PR);
|
2017-10-20 18:56:33 +02:00
|
|
|
initializeHexagonHardwareLoopsPass(PR);
|
2020-11-20 00:52:21 +01:00
|
|
|
initializeHexagonLoopIdiomRecognizeLegacyPassPass(PR);
|
2017-06-27 20:37:16 +02:00
|
|
|
initializeHexagonNewValueJumpPass(PR);
|
2017-07-10 20:38:52 +02:00
|
|
|
initializeHexagonOptAddrModePass(PR);
|
|
|
|
initializeHexagonPacketizerPass(PR);
|
2017-10-30 15:11:52 +01:00
|
|
|
initializeHexagonRDFOptPass(PR);
|
2018-05-04 17:04:48 +02:00
|
|
|
initializeHexagonSplitDoubleRegsPass(PR);
|
2020-09-07 21:26:48 +02:00
|
|
|
initializeHexagonVectorCombineLegacyPass(PR);
|
|
|
|
initializeHexagonVectorLoopCarriedReuseLegacyPassPass(PR);
|
2018-01-26 22:17:14 +01:00
|
|
|
initializeHexagonVExtractPass(PR);
|
2017-01-26 22:41:10 +01:00
|
|
|
}
|
|
|
|
|
2015-06-11 21:41:26 +02:00
|
|
|
HexagonTargetMachine::HexagonTargetMachine(const Target &T, const Triple &TT,
|
2011-12-12 22:14:40 +01:00
|
|
|
StringRef CPU, StringRef FS,
|
2012-03-17 10:24:09 +01:00
|
|
|
const TargetOptions &Options,
|
2016-05-19 00:04:49 +02:00
|
|
|
Optional<Reloc::Model> RM,
|
2017-08-03 04:16:21 +02:00
|
|
|
Optional<CodeModel::Model> CM,
|
|
|
|
CodeGenOpt::Level OL, bool JIT)
|
2016-02-12 15:47:38 +01:00
|
|
|
// Specify the vector alignment explicitly. For v512x1, the calculated
|
|
|
|
// alignment would be 512*alignment(i1), which is 512 bytes, instead of
|
|
|
|
// the required minimum of 64 bytes.
|
2017-10-13 00:57:28 +02:00
|
|
|
: LLVMTargetMachine(
|
2017-08-03 04:16:21 +02:00
|
|
|
T,
|
|
|
|
"e-m:e-p:32:32:32-a:0-n16:32-"
|
|
|
|
"i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-"
|
|
|
|
"v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048",
|
|
|
|
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
|
2018-12-07 13:10:23 +01:00
|
|
|
getEffectiveCodeModel(CM, CodeModel::Small),
|
|
|
|
(HexagonNoOpt ? CodeGenOpt::None : OL)),
|
2019-08-15 17:54:37 +02:00
|
|
|
TLOF(std::make_unique<HexagonTargetObjectFile>()) {
|
2016-08-25 00:27:36 +02:00
|
|
|
initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
|
2015-08-05 20:35:37 +02:00
|
|
|
initAsmInfo();
|
2011-12-12 22:14:40 +01:00
|
|
|
}
|
|
|
|
|
2015-08-05 20:35:37 +02:00
|
|
|
const HexagonSubtarget *
|
|
|
|
HexagonTargetMachine::getSubtargetImpl(const Function &F) const {
|
Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.
Rename AttributeSetImpl to AttributeListImpl to follow suit.
It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.
Reviewers: sanjoy, javed.absar, chandlerc, pete
Reviewed By: pete
Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits
Differential Revision: https://reviews.llvm.org/D31102
llvm-svn: 298393
2017-03-21 17:57:19 +01:00
|
|
|
AttributeList FnAttrs = F.getAttributes();
|
2015-08-05 20:35:37 +02:00
|
|
|
Attribute CPUAttr =
|
Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.
Rename AttributeSetImpl to AttributeListImpl to follow suit.
It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.
Reviewers: sanjoy, javed.absar, chandlerc, pete
Reviewed By: pete
Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits
Differential Revision: https://reviews.llvm.org/D31102
llvm-svn: 298393
2017-03-21 17:57:19 +01:00
|
|
|
FnAttrs.getAttribute(AttributeList::FunctionIndex, "target-cpu");
|
2015-08-05 20:35:37 +02:00
|
|
|
Attribute FSAttr =
|
Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.
Rename AttributeSetImpl to AttributeListImpl to follow suit.
It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.
Reviewers: sanjoy, javed.absar, chandlerc, pete
Reviewed By: pete
Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits
Differential Revision: https://reviews.llvm.org/D31102
llvm-svn: 298393
2017-03-21 17:57:19 +01:00
|
|
|
FnAttrs.getAttribute(AttributeList::FunctionIndex, "target-features");
|
2015-08-05 20:35:37 +02:00
|
|
|
|
2020-08-28 22:02:42 +02:00
|
|
|
std::string CPU =
|
|
|
|
CPUAttr.isValid() ? CPUAttr.getValueAsString().str() : TargetCPU;
|
|
|
|
std::string FS =
|
|
|
|
FSAttr.isValid() ? FSAttr.getValueAsString().str() : TargetFS;
|
2020-01-17 23:29:40 +01:00
|
|
|
// Append the preexisting target features last, so that +mattr overrides
|
|
|
|
// the "unsafe-fp-math" function attribute.
|
|
|
|
// Creating a separate target feature is not strictly necessary, it only
|
|
|
|
// exists to make "unsafe-fp-math" force creating a new subtarget.
|
|
|
|
|
2021-03-24 21:45:04 +01:00
|
|
|
if (F.getFnAttribute("unsafe-fp-math").getValueAsBool())
|
2020-01-17 23:29:40 +01:00
|
|
|
FS = FS.empty() ? "+unsafe-fp" : "+unsafe-fp," + FS;
|
2015-08-05 20:35:37 +02:00
|
|
|
|
|
|
|
auto &I = SubtargetMap[CPU + FS];
|
|
|
|
if (!I) {
|
|
|
|
// This needs to be done before we create a new subtarget since any
|
|
|
|
// creation will depend on the TM and the code generation flags on the
|
|
|
|
// function that reside in TargetOptions.
|
|
|
|
resetTargetOptions(F);
|
2019-08-15 17:54:37 +02:00
|
|
|
I = std::make_unique<HexagonSubtarget>(TargetTriple, CPU, FS, *this);
|
2015-08-05 20:35:37 +02:00
|
|
|
}
|
|
|
|
return I.get();
|
|
|
|
}
|
|
|
|
|
2017-01-26 22:41:10 +01:00
|
|
|
void HexagonTargetMachine::adjustPassManager(PassManagerBuilder &PMB) {
|
|
|
|
PMB.addExtension(
|
|
|
|
PassManagerBuilder::EP_LateLoopOptimizations,
|
|
|
|
[&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
|
|
|
|
PM.add(createHexagonLoopIdiomPass());
|
|
|
|
});
|
2017-09-21 23:48:23 +02:00
|
|
|
PMB.addExtension(
|
2020-09-21 22:43:42 +02:00
|
|
|
PassManagerBuilder::EP_LoopOptimizerEnd,
|
|
|
|
[&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
|
|
|
|
PM.add(createHexagonVectorLoopCarriedReuseLegacyPass());
|
|
|
|
});
|
2017-01-26 22:41:10 +01:00
|
|
|
}
|
|
|
|
|
2021-05-04 01:09:56 +02:00
|
|
|
void HexagonTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
|
2020-11-20 00:52:21 +01:00
|
|
|
PB.registerLateLoopOptimizationsEPCallback(
|
|
|
|
[=](LoopPassManager &LPM, PassBuilder::OptimizationLevel Level) {
|
|
|
|
LPM.addPass(HexagonLoopIdiomRecognitionPass());
|
|
|
|
});
|
2020-12-30 04:54:32 +01:00
|
|
|
PB.registerLoopOptimizerEndEPCallback(
|
|
|
|
[=](LoopPassManager &LPM, PassBuilder::OptimizationLevel Level) {
|
2020-09-30 22:23:21 +02:00
|
|
|
LPM.addPass(HexagonVectorLoopCarriedReusePass());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
(Re-landing) Expose a TargetMachine::getTargetTransformInfo function
Re-land r321234. It had to be reverted because it broke the shared
library build. The shared library build broke because there was a
missing LLVMBuild dependency from lib/Passes (which calls
TargetMachine::getTargetIRAnalysis) to lib/Target. As far as I can
tell, this problem was always there but was somehow masked
before (perhaps because TargetMachine::getTargetIRAnalysis was a
virtual function).
Original commit message:
This makes the TargetMachine interface a bit simpler. We still need
the std::function in TargetIRAnalysis to avoid having to add a
dependency from Analysis to Target.
See discussion:
http://lists.llvm.org/pipermail/llvm-dev/2017-December/119749.html
I avoided adding all of the backend owners to this review since the
change is simple, but let me know if you feel differently about this.
Reviewers: echristo, MatzeB, hfinkel
Reviewed By: hfinkel
Subscribers: jholewinski, jfb, arsenm, dschuff, mcrosier, sdardis, nemanjai, nhaehnle, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, llvm-commits
Differential Revision: https://reviews.llvm.org/D41464
llvm-svn: 321375
2017-12-22 19:21:59 +01:00
|
|
|
TargetTransformInfo
|
|
|
|
HexagonTargetMachine::getTargetTransformInfo(const Function &F) {
|
|
|
|
return TargetTransformInfo(HexagonTTIImpl(this, F));
|
2015-08-05 20:35:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-11-21 00:37:18 +01:00
|
|
|
HexagonTargetMachine::~HexagonTargetMachine() {}
|
|
|
|
|
2012-02-03 06:12:41 +01:00
|
|
|
namespace {
|
|
|
|
/// Hexagon Code Generator Pass Configuration Options.
|
|
|
|
class HexagonPassConfig : public TargetPassConfig {
|
|
|
|
public:
|
2017-05-30 23:36:41 +02:00
|
|
|
HexagonPassConfig(HexagonTargetMachine &TM, PassManagerBase &PM)
|
2016-05-27 22:48:39 +02:00
|
|
|
: TargetPassConfig(TM, PM) {}
|
2012-02-03 06:12:41 +01:00
|
|
|
|
|
|
|
HexagonTargetMachine &getHexagonTargetMachine() const {
|
|
|
|
return getTM<HexagonTargetMachine>();
|
|
|
|
}
|
|
|
|
|
2014-04-29 09:58:16 +02:00
|
|
|
ScheduleDAGInstrs *
|
|
|
|
createMachineScheduler(MachineSchedContext *C) const override {
|
2013-09-20 07:14:41 +02:00
|
|
|
return createVLIWMachineSched(C);
|
|
|
|
}
|
|
|
|
|
2015-07-08 21:22:28 +02:00
|
|
|
void addIRPasses() override;
|
2014-04-29 09:58:16 +02:00
|
|
|
bool addInstSelector() override;
|
2014-12-11 22:26:47 +01:00
|
|
|
void addPreRegAlloc() override;
|
|
|
|
void addPostRegAlloc() override;
|
|
|
|
void addPreSched2() override;
|
|
|
|
void addPreEmitPass() override;
|
2012-02-03 06:12:41 +01:00
|
|
|
};
|
|
|
|
} // namespace
|
|
|
|
|
2012-02-04 03:56:59 +01:00
|
|
|
TargetPassConfig *HexagonTargetMachine::createPassConfig(PassManagerBase &PM) {
|
2017-05-30 23:36:41 +02:00
|
|
|
return new HexagonPassConfig(*this, PM);
|
2012-02-03 06:12:41 +01:00
|
|
|
}
|
|
|
|
|
2015-07-08 21:22:28 +02:00
|
|
|
void HexagonPassConfig::addIRPasses() {
|
|
|
|
TargetPassConfig::addIRPasses();
|
|
|
|
bool NoOpt = (getOptLevel() == CodeGenOpt::None);
|
2015-07-09 16:51:21 +02:00
|
|
|
|
2018-01-24 18:48:11 +01:00
|
|
|
if (!NoOpt) {
|
2020-07-29 22:54:07 +02:00
|
|
|
if (EnableInstSimplify)
|
|
|
|
addPass(createInstSimplifyLegacyPass());
|
2018-01-24 18:48:11 +01:00
|
|
|
addPass(createDeadCodeEliminationPass());
|
|
|
|
}
|
|
|
|
|
2017-05-18 19:21:13 +02:00
|
|
|
addPass(createAtomicExpandPass());
|
2018-08-03 00:17:53 +02:00
|
|
|
|
2015-07-14 19:07:24 +02:00
|
|
|
if (!NoOpt) {
|
2018-08-03 00:17:53 +02:00
|
|
|
if (EnableInitialCFGCleanup)
|
2020-07-16 11:52:55 +02:00
|
|
|
addPass(createCFGSimplificationPass(SimplifyCFGOptions()
|
|
|
|
.forwardSwitchCondToPhi(true)
|
|
|
|
.convertSwitchToLookupTable(true)
|
|
|
|
.needCanonicalLoops(false)
|
Reland [SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default, enable late in pipeline
This was reverted in 503deec2183d466dad64b763bab4e15fd8804239
because it caused gigantic increase (3x) in branch mispredictions
in certain benchmarks on certain CPU's,
see https://reviews.llvm.org/D84108#2227365.
It has since been investigated and here are the results:
https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200907/827578.html
> It's an amazingly severe regression, but it's also all due to branch
> mispredicts (about 3x without this). The code layout looks ok so there's
> probably something else to deal with. I'm not sure there's anything we can
> reasonably do so we'll just have to take the hit for now and wait for
> another code reorganization to make the branch predictor a bit more happy :)
>
> Thanks for giving us some time to investigate and feel free to recommit
> whenever you'd like.
>
> -eric
So let's just reland this.
Original commit message:
I've been looking at missed vectorizations in one codebase.
One particular thing that stands out is that some of the loops
reach vectorizer in a rather mangled form, with weird PHI's,
and some of the loops aren't even in a rotated form.
After taking a more detailed look, that happened because
the loop's headers were too big by then. It is evident that
SimplifyCFG's common code hoisting transform is at fault there,
because the pattern it handles is precisely the unrotated
loop basic block structure.
Surprizingly, `SimplifyCFGOpt::HoistThenElseCodeToIf()` is enabled
by default, and is always run, unlike it's friend, common code sinking
transform, `SinkCommonCodeFromPredecessors()`, which is not enabled
by default and is only run once very late in the pipeline.
I'm proposing to harmonize this, and disable common code hoisting
until //late// in pipeline. Definition of //late// may vary,
here currently i've picked the same one as for code sinking,
but i suppose we could enable it as soon as right after
loop rotation happens.
Experimentation shows that this does indeed unsurprizingly help,
more loops got rotated, although other issues remain elsewhere.
Now, this undoubtedly seriously shakes phase ordering.
This will undoubtedly be a mixed bag in terms of both compile- and
run- time performance, codesize. Since we no longer aggressively
hoist+deduplicate common code, we don't pay the price of said hoisting
(which wasn't big). That may allow more loops to be rotated,
so we pay that price. That, in turn, that may enable all the transforms
that require canonical (rotated) loop form, including but not limited to
vectorization, so we pay that too. And in general, no deduplication means
more [duplicate] instructions going through the optimizations. But there's still
late hoisting, some of them will be caught late.
As per benchmarks i've run {F12360204}, this is mostly within the noise,
there are some small improvements, some small regressions.
One big regression i saw i fixed in rG8d487668d09fb0e4e54f36207f07c1480ffabbfd, but i'm sure
this will expose many more pre-existing missed optimizations, as usual :S
llvm-compile-time-tracker.com thoughts on this:
http://llvm-compile-time-tracker.com/compare.php?from=e40315d2b4ed1e38962a8f33ff151693ed4ada63&to=c8289c0ecbf235da9fb0e3bc052e3c0d6bff5cf9&stat=instructions
* this does regress compile-time by +0.5% geomean (unsurprizingly)
* size impact varies; for ThinLTO it's actually an improvement
The largest fallout appears to be in GVN's load partial redundancy
elimination, it spends *much* more time in
`MemoryDependenceResults::getNonLocalPointerDependency()`.
Non-local `MemoryDependenceResults` is widely-known to be, uh, costly.
There does not appear to be a proper solution to this issue,
other than silencing the compile-time performance regression
by tuning cut-off thresholds in `MemoryDependenceResults`,
at the cost of potentially regressing run-time performance.
D84609 attempts to move in that direction, but the path is unclear
and is going to take some time.
If we look at stats before/after diffs, some excerpts:
* RawSpeed (the target) {F12360200}
* -14 (-73.68%) loops not rotated due to the header size (yay)
* -272 (-0.67%) `"Number of live out of a loop variables"` - good for vectorizer
* -3937 (-64.19%) common instructions hoisted
* +561 (+0.06%) x86 asm instructions
* -2 basic blocks
* +2418 (+0.11%) IR instructions
* vanilla test-suite + RawSpeed + darktable {F12360201}
* -36396 (-65.29%) common instructions hoisted
* +1676 (+0.02%) x86 asm instructions
* +662 (+0.06%) basic blocks
* +4395 (+0.04%) IR instructions
It is likely to be sub-optimal for when optimizing for code size,
so one might want to change tune pipeline by enabling sinking/hoisting
when optimizing for size.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D84108
This reverts commit 503deec2183d466dad64b763bab4e15fd8804239.
2020-09-07 22:54:06 +02:00
|
|
|
.hoistCommonInsts(true)
|
2020-07-16 11:52:55 +02:00
|
|
|
.sinkCommonInsts(true)));
|
2016-07-22 16:22:43 +02:00
|
|
|
if (EnableLoopPrefetch)
|
|
|
|
addPass(createLoopDataPrefetchPass());
|
2020-09-07 21:26:48 +02:00
|
|
|
if (EnableVectorCombine)
|
|
|
|
addPass(createHexagonVectorCombineLegacyPass());
|
2015-07-14 19:07:24 +02:00
|
|
|
if (EnableCommGEP)
|
|
|
|
addPass(createHexagonCommonGEP());
|
|
|
|
// Replace certain combinations of shifts and ands with extracts.
|
|
|
|
if (EnableGenExtract)
|
|
|
|
addPass(createHexagonGenExtract());
|
|
|
|
}
|
2015-07-08 21:22:28 +02:00
|
|
|
}
|
|
|
|
|
2012-02-03 06:12:41 +01:00
|
|
|
bool HexagonPassConfig::addInstSelector() {
|
2013-06-19 23:36:55 +02:00
|
|
|
HexagonTargetMachine &TM = getHexagonTargetMachine();
|
2013-05-06 23:25:45 +02:00
|
|
|
bool NoOpt = (getOptLevel() == CodeGenOpt::None);
|
2013-03-27 12:14:24 +01:00
|
|
|
|
2015-10-19 21:10:48 +02:00
|
|
|
if (!NoOpt)
|
|
|
|
addPass(createHexagonOptimizeSZextends());
|
|
|
|
|
2013-05-06 23:25:45 +02:00
|
|
|
addPass(createHexagonISelDag(TM, getOptLevel()));
|
2013-03-27 12:14:24 +01:00
|
|
|
|
2013-05-06 23:25:45 +02:00
|
|
|
if (!NoOpt) {
|
2018-01-26 22:17:14 +01:00
|
|
|
if (EnableVExtractOpt)
|
|
|
|
addPass(createHexagonVExtract());
|
2015-07-14 21:30:21 +02:00
|
|
|
// Create logical operations on predicate registers.
|
|
|
|
if (EnableGenPred)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonGenPredicate());
|
2015-10-21 00:57:13 +02:00
|
|
|
// Rotate loops to expose bit-simplification opportunities.
|
|
|
|
if (EnableLoopResched)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonLoopRescheduling());
|
2015-10-16 22:38:54 +02:00
|
|
|
// Split double registers.
|
|
|
|
if (!DisableHSDR)
|
|
|
|
addPass(createHexagonSplitDoubleRegs());
|
2015-10-21 00:57:13 +02:00
|
|
|
// Bit simplification.
|
|
|
|
if (EnableBitSimplify)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonBitSimplify());
|
2013-03-27 12:14:24 +01:00
|
|
|
addPass(createHexagonPeephole());
|
2016-07-28 22:01:59 +02:00
|
|
|
// Constant propagation.
|
|
|
|
if (!DisableHCP) {
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonConstPropagationPass());
|
|
|
|
addPass(&UnreachableMachineBlockElimID);
|
2016-07-28 22:01:59 +02:00
|
|
|
}
|
2015-07-08 16:47:34 +02:00
|
|
|
if (EnableGenInsert)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonGenInsert());
|
2015-10-06 17:49:14 +02:00
|
|
|
if (EnableEarlyIf)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonEarlyIfConversion());
|
2013-05-06 23:25:45 +02:00
|
|
|
}
|
2013-03-27 12:14:24 +01:00
|
|
|
|
2011-12-12 22:14:40 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-12-11 22:26:47 +01:00
|
|
|
void HexagonPassConfig::addPreRegAlloc() {
|
2015-10-16 21:43:56 +02:00
|
|
|
if (getOptLevel() != CodeGenOpt::None) {
|
2017-10-13 21:02:59 +02:00
|
|
|
if (EnableCExtOpt)
|
|
|
|
addPass(createHexagonConstExtenders());
|
2016-08-25 00:27:36 +02:00
|
|
|
if (EnableExpandCondsets)
|
|
|
|
insertPass(&RegisterCoalescerID, &HexagonExpandCondsetsID);
|
2015-10-16 21:43:56 +02:00
|
|
|
if (!DisableStoreWidening)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonStoreWidening());
|
2013-05-06 23:25:45 +02:00
|
|
|
if (!DisableHardwareLoops)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonHardwareLoops());
|
2015-10-16 21:43:56 +02:00
|
|
|
}
|
2016-07-29 18:44:44 +02:00
|
|
|
if (TM->getOptLevel() >= CodeGenOpt::Default)
|
|
|
|
addPass(&MachinePipelinerID);
|
2011-12-12 22:14:40 +01:00
|
|
|
}
|
|
|
|
|
2014-12-11 22:26:47 +01:00
|
|
|
void HexagonPassConfig::addPostRegAlloc() {
|
2016-01-12 20:09:01 +01:00
|
|
|
if (getOptLevel() != CodeGenOpt::None) {
|
|
|
|
if (EnableRDFOpt)
|
|
|
|
addPass(createHexagonRDFOpt());
|
2013-05-06 23:25:45 +02:00
|
|
|
if (!DisableHexagonCFGOpt)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonCFGOptimizer());
|
2016-04-29 17:49:13 +02:00
|
|
|
if (!DisableAModeOpt)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonOptAddrMode());
|
2016-01-12 20:09:01 +01:00
|
|
|
}
|
2011-12-12 22:14:40 +01:00
|
|
|
}
|
|
|
|
|
2014-12-11 22:26:47 +01:00
|
|
|
void HexagonPassConfig::addPreSched2() {
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonCopyToCombine());
|
2013-05-07 21:53:00 +02:00
|
|
|
if (getOptLevel() != CodeGenOpt::None)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(&IfConverterID);
|
2015-02-02 23:11:43 +01:00
|
|
|
addPass(createHexagonSplitConst32AndConst64());
|
2011-12-12 22:14:40 +01:00
|
|
|
}
|
|
|
|
|
2014-12-11 22:26:47 +01:00
|
|
|
void HexagonPassConfig::addPreEmitPass() {
|
2013-05-06 23:25:45 +02:00
|
|
|
bool NoOpt = (getOptLevel() == CodeGenOpt::None);
|
2011-12-12 22:14:40 +01:00
|
|
|
|
2013-05-06 23:25:45 +02:00
|
|
|
if (!NoOpt)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonNewValueJump());
|
2012-05-12 07:10:30 +02:00
|
|
|
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonBranchRelaxation());
|
2016-04-19 20:30:18 +02:00
|
|
|
|
2013-05-06 23:25:45 +02:00
|
|
|
if (!NoOpt) {
|
|
|
|
if (!DisableHardwareLoops)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonFixupHwLoops());
|
2015-07-20 23:23:25 +02:00
|
|
|
// Generate MUX from pairs of conditional transfers.
|
|
|
|
if (EnableGenMux)
|
2017-06-08 23:25:36 +02:00
|
|
|
addPass(createHexagonGenMux());
|
2017-12-11 19:57:54 +01:00
|
|
|
}
|
|
|
|
|
2018-08-17 16:24:24 +02:00
|
|
|
// Packetization is mandatory: it handles gather/scatter at all opt levels.
|
|
|
|
addPass(createHexagonPacketizer(NoOpt), false);
|
2017-12-11 19:57:54 +01:00
|
|
|
|
2016-08-01 21:36:39 +02:00
|
|
|
if (EnableVectorPrint)
|
|
|
|
addPass(createHexagonVectorPrint(), false);
|
2015-10-19 19:46:01 +02:00
|
|
|
|
|
|
|
// Add CFI instructions if necessary.
|
|
|
|
addPass(createHexagonCallFrameInformation(), false);
|
2011-12-12 22:14:40 +01:00
|
|
|
}
|