Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- HexagonTargetMachine.cpp - Define TargetMachine for Hexagon -------===// |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 9 | // Implements the info about Hexagon target spec. |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 13 | #include "HexagonTargetMachine.h" |
| 14 | #include "Hexagon.h" |
| 15 | #include "HexagonISelLowering.h" |
Sergei Larin | 4d8986a | 2012-09-04 14:49:56 +0000 | [diff] [blame] | 16 | #include "HexagonMachineScheduler.h" |
Jyotsna Verma | 5eb5980 | 2013-05-07 19:53:00 +0000 | [diff] [blame] | 17 | #include "HexagonTargetObjectFile.h" |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 18 | #include "HexagonTargetTransformInfo.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/Passes.h" |
Matthias Braun | 31d19d4 | 2016-05-10 03:21:59 +0000 | [diff] [blame] | 20 | #include "llvm/CodeGen/TargetPassConfig.h" |
Chandler Carruth | 30d69c2 | 2015-02-13 10:01:29 +0000 | [diff] [blame] | 21 | #include "llvm/IR/LegacyPassManager.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 22 | #include "llvm/IR/Module.h" |
Benjamin Kramer | ae87d7b | 2012-02-06 10:19:29 +0000 | [diff] [blame] | 23 | #include "llvm/Support/CommandLine.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 24 | #include "llvm/Support/TargetRegistry.h" |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 25 | #include "llvm/Transforms/IPO/PassManagerBuilder.h" |
Chandler Carruth | 6bda14b | 2017-06-06 11:49:48 +0000 | [diff] [blame] | 26 | #include "llvm/Transforms/Scalar.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 27 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 28 | using namespace llvm; |
| 29 | |
Krzysztof Parzyszek | 7c9c058 | 2017-10-13 19:02:59 +0000 | [diff] [blame] | 30 | static cl::opt<bool> EnableCExtOpt("hexagon-cext", cl::Hidden, cl::ZeroOrMore, |
| 31 | cl::init(true), cl::desc("Enable Hexagon constant-extender optimization")); |
| 32 | |
Krzysztof Parzyszek | 1279881 | 2016-01-12 19:09:01 +0000 | [diff] [blame] | 33 | static cl::opt<bool> EnableRDFOpt("rdf-opt", cl::Hidden, cl::ZeroOrMore, |
| 34 | cl::init(true), cl::desc("Enable RDF-based optimizations")); |
| 35 | |
| 36 | static cl::opt<bool> DisableHardwareLoops("disable-hexagon-hwloops", |
Krzysztof Parzyszek | c05dff1 | 2015-03-31 13:35:12 +0000 | [diff] [blame] | 37 | cl::Hidden, cl::desc("Disable Hardware Loops for Hexagon target")); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 38 | |
Krzysztof Parzyszek | f5cbac9 | 2016-04-29 15:49:13 +0000 | [diff] [blame] | 39 | static cl::opt<bool> DisableAModeOpt("disable-hexagon-amodeopt", |
| 40 | cl::Hidden, cl::ZeroOrMore, cl::init(false), |
| 41 | cl::desc("Disable Hexagon Addressing Mode Optimization")); |
| 42 | |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 43 | static cl::opt<bool> DisableHexagonCFGOpt("disable-hexagon-cfgopt", |
Krzysztof Parzyszek | c05dff1 | 2015-03-31 13:35:12 +0000 | [diff] [blame] | 44 | cl::Hidden, cl::ZeroOrMore, cl::init(false), |
| 45 | cl::desc("Disable Hexagon CFG Optimization")); |
| 46 | |
Krzysztof Parzyszek | 167d918 | 2016-07-28 20:01:59 +0000 | [diff] [blame] | 47 | static cl::opt<bool> DisableHCP("disable-hcp", cl::init(false), cl::Hidden, |
| 48 | cl::ZeroOrMore, cl::desc("Disable Hexagon constant propagation")); |
| 49 | |
Krzysztof Parzyszek | 5b7dd0c | 2015-10-16 19:43:56 +0000 | [diff] [blame] | 50 | static cl::opt<bool> DisableStoreWidening("disable-store-widen", |
| 51 | cl::Hidden, cl::init(false), cl::desc("Disable store widening")); |
| 52 | |
Krzysztof Parzyszek | c05dff1 | 2015-03-31 13:35:12 +0000 | [diff] [blame] | 53 | static cl::opt<bool> EnableExpandCondsets("hexagon-expand-condsets", |
| 54 | cl::init(true), cl::Hidden, cl::ZeroOrMore, |
| 55 | cl::desc("Early expansion of MUX")); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 56 | |
Krzysztof Parzyszek | fb33824 | 2015-10-06 15:49:14 +0000 | [diff] [blame] | 57 | static cl::opt<bool> EnableEarlyIf("hexagon-eif", cl::init(true), cl::Hidden, |
| 58 | cl::ZeroOrMore, cl::desc("Enable early if-conversion")); |
| 59 | |
Krzysztof Parzyszek | 21b53a5 | 2015-07-08 14:47:34 +0000 | [diff] [blame] | 60 | static cl::opt<bool> EnableGenInsert("hexagon-insert", cl::init(true), |
| 61 | cl::Hidden, cl::desc("Generate \"insert\" instructions")); |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 62 | |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 63 | static cl::opt<bool> EnableCommGEP("hexagon-commgep", cl::init(true), |
| 64 | cl::Hidden, cl::ZeroOrMore, cl::desc("Enable commoning of GEP instructions")); |
| 65 | |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 66 | static cl::opt<bool> EnableGenExtract("hexagon-extract", cl::init(true), |
| 67 | cl::Hidden, cl::desc("Generate \"extract\" instructions")); |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 68 | |
Krzysztof Parzyszek | 9217220 | 2015-07-20 21:23:25 +0000 | [diff] [blame] | 69 | static cl::opt<bool> EnableGenMux("hexagon-mux", cl::init(true), cl::Hidden, |
| 70 | cl::desc("Enable converting conditional transfers into MUX instructions")); |
| 71 | |
Krzysztof Parzyszek | 7587447 | 2015-07-14 19:30:21 +0000 | [diff] [blame] | 72 | static cl::opt<bool> EnableGenPred("hexagon-gen-pred", cl::init(true), |
| 73 | cl::Hidden, cl::desc("Enable conversion of arithmetic operations to " |
| 74 | "predicate instructions")); |
| 75 | |
Krzysztof Parzyszek | d3d0a4b | 2016-07-22 14:22:43 +0000 | [diff] [blame] | 76 | static cl::opt<bool> EnableLoopPrefetch("hexagon-loop-prefetch", |
| 77 | cl::init(false), cl::Hidden, cl::ZeroOrMore, |
| 78 | cl::desc("Enable loop data prefetch on Hexagon")); |
| 79 | |
Krzysztof Parzyszek | a7c5f04 | 2015-10-16 20:38:54 +0000 | [diff] [blame] | 80 | static cl::opt<bool> DisableHSDR("disable-hsdr", cl::init(false), cl::Hidden, |
| 81 | cl::desc("Disable splitting double registers")); |
| 82 | |
Krzysztof Parzyszek | ced9941 | 2015-10-20 22:57:13 +0000 | [diff] [blame] | 83 | static cl::opt<bool> EnableBitSimplify("hexagon-bit", cl::init(true), |
| 84 | cl::Hidden, cl::desc("Bit simplification")); |
| 85 | |
| 86 | static cl::opt<bool> EnableLoopResched("hexagon-loop-resched", cl::init(true), |
| 87 | cl::Hidden, cl::desc("Loop rescheduling")); |
| 88 | |
Krzysztof Parzyszek | d559005 | 2016-05-11 15:01:30 +0000 | [diff] [blame] | 89 | static cl::opt<bool> HexagonNoOpt("hexagon-noopt", cl::init(false), |
| 90 | cl::Hidden, cl::desc("Disable backend optimizations")); |
| 91 | |
Ron Lieberman | 8123b96 | 2016-08-01 19:36:39 +0000 | [diff] [blame] | 92 | static cl::opt<bool> EnableVectorPrint("enable-hexagon-vector-print", |
| 93 | cl::Hidden, cl::ZeroOrMore, cl::init(false), |
| 94 | cl::desc("Enable Hexagon Vector print instr pass")); |
| 95 | |
Krzysztof Parzyszek | 95614ac | 2018-01-26 21:17:14 +0000 | [diff] [blame] | 96 | static cl::opt<bool> EnableVExtractOpt("hexagon-opt-vextract", cl::Hidden, |
| 97 | cl::ZeroOrMore, cl::init(true), cl::desc("Enable vextract optimization")); |
| 98 | |
Krzysztof Parzyszek | d91a9e2 | 2018-08-02 22:17:53 +0000 | [diff] [blame] | 99 | static cl::opt<bool> EnableInitialCFGCleanup("hexagon-initial-cfg-cleanup", |
| 100 | cl::Hidden, cl::ZeroOrMore, cl::init(true), |
| 101 | cl::desc("Simplify the CFG after atomic expansion pass")); |
| 102 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 103 | /// HexagonTargetMachineModule - Note that this is used on hosts that |
| 104 | /// cannot link in a library unless there are references into the |
| 105 | /// library. In particular, it seems that it is not possible to get |
| 106 | /// things to work on Win32 without this. Though it is unused, do not |
| 107 | /// remove it. |
| 108 | extern "C" int HexagonTargetMachineModule; |
| 109 | int HexagonTargetMachineModule = 0; |
| 110 | |
Sergei Larin | 4d8986a | 2012-09-04 14:49:56 +0000 | [diff] [blame] | 111 | static ScheduleDAGInstrs *createVLIWMachineSched(MachineSchedContext *C) { |
Krzysztof Parzyszek | 697297a | 2017-08-28 15:52:54 +0000 | [diff] [blame] | 112 | ScheduleDAGMILive *DAG = |
| 113 | new VLIWMachineScheduler(C, make_unique<ConvergingVLIWScheduler>()); |
Krzysztof Parzyszek | 95da97e | 2017-08-28 16:24:22 +0000 | [diff] [blame] | 114 | DAG->addMutation(make_unique<HexagonSubtarget::UsrOverflowMutation>()); |
| 115 | DAG->addMutation(make_unique<HexagonSubtarget::HVXMemLatencyMutation>()); |
| 116 | DAG->addMutation(make_unique<HexagonSubtarget::CallMutation>()); |
Krzysztof Parzyszek | 697297a | 2017-08-28 15:52:54 +0000 | [diff] [blame] | 117 | DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI)); |
| 118 | return DAG; |
Sergei Larin | 4d8986a | 2012-09-04 14:49:56 +0000 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | static MachineSchedRegistry |
| 122 | SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler", |
| 123 | createVLIWMachineSched); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 124 | |
Krzysztof Parzyszek | c05dff1 | 2015-03-31 13:35:12 +0000 | [diff] [blame] | 125 | namespace llvm { |
Krzysztof Parzyszek | 951fb36 | 2016-08-24 22:27:36 +0000 | [diff] [blame] | 126 | extern char &HexagonExpandCondsetsID; |
Krzysztof Parzyszek | b404fae | 2018-02-20 14:29:43 +0000 | [diff] [blame] | 127 | void initializeHexagonBitSimplifyPass(PassRegistry&); |
Krzysztof Parzyszek | 7c9c058 | 2017-10-13 19:02:59 +0000 | [diff] [blame] | 128 | void initializeHexagonConstExtendersPass(PassRegistry&); |
Krzysztof Parzyszek | 96690ce | 2018-02-23 20:33:26 +0000 | [diff] [blame] | 129 | void initializeHexagonConstPropagationPass(PassRegistry&); |
Krzysztof Parzyszek | 1966fd7 | 2017-08-09 21:22:05 +0000 | [diff] [blame] | 130 | void initializeHexagonEarlyIfConversionPass(PassRegistry&); |
Krzysztof Parzyszek | 951fb36 | 2016-08-24 22:27:36 +0000 | [diff] [blame] | 131 | void initializeHexagonExpandCondsetsPass(PassRegistry&); |
Krzysztof Parzyszek | de2ac17 | 2017-06-13 16:07:36 +0000 | [diff] [blame] | 132 | void initializeHexagonGenMuxPass(PassRegistry&); |
Krzysztof Parzyszek | 3818aea | 2017-10-20 16:56:33 +0000 | [diff] [blame] | 133 | void initializeHexagonHardwareLoopsPass(PassRegistry&); |
Krzysztof Parzyszek | df4a05d | 2017-07-10 18:38:52 +0000 | [diff] [blame] | 134 | void initializeHexagonLoopIdiomRecognizePass(PassRegistry&); |
Pranav Bhandarkar | 931d0b7 | 2017-09-21 21:48:23 +0000 | [diff] [blame] | 135 | void initializeHexagonVectorLoopCarriedReusePass(PassRegistry&); |
Krzysztof Parzyszek | 5ddd2e5 | 2017-06-27 18:37:16 +0000 | [diff] [blame] | 136 | void initializeHexagonNewValueJumpPass(PassRegistry&); |
Krzysztof Parzyszek | df4a05d | 2017-07-10 18:38:52 +0000 | [diff] [blame] | 137 | void initializeHexagonOptAddrModePass(PassRegistry&); |
| 138 | void initializeHexagonPacketizerPass(PassRegistry&); |
Krzysztof Parzyszek | bef1c56 | 2017-10-30 14:11:52 +0000 | [diff] [blame] | 139 | void initializeHexagonRDFOptPass(PassRegistry&); |
Krzysztof Parzyszek | effcc2f | 2018-05-04 15:04:48 +0000 | [diff] [blame] | 140 | void initializeHexagonSplitDoubleRegsPass(PassRegistry&); |
Krzysztof Parzyszek | 95614ac | 2018-01-26 21:17:14 +0000 | [diff] [blame] | 141 | void initializeHexagonVExtractPass(PassRegistry&); |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 142 | Pass *createHexagonLoopIdiomPass(); |
Pranav Bhandarkar | 931d0b7 | 2017-09-21 21:48:23 +0000 | [diff] [blame] | 143 | Pass *createHexagonVectorLoopCarriedReusePass(); |
Krzysztof Parzyszek | 951fb36 | 2016-08-24 22:27:36 +0000 | [diff] [blame] | 144 | |
Krzysztof Parzyszek | ced9941 | 2015-10-20 22:57:13 +0000 | [diff] [blame] | 145 | FunctionPass *createHexagonBitSimplify(); |
Krzysztof Parzyszek | 7b59ae2 | 2016-04-19 18:30:18 +0000 | [diff] [blame] | 146 | FunctionPass *createHexagonBranchRelaxation(); |
Krzysztof Parzyszek | db86770 | 2015-10-19 17:46:01 +0000 | [diff] [blame] | 147 | FunctionPass *createHexagonCallFrameInformation(); |
Colin LeMahieu | 56efafc | 2015-06-15 19:05:35 +0000 | [diff] [blame] | 148 | FunctionPass *createHexagonCFGOptimizer(); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 149 | FunctionPass *createHexagonCommonGEP(); |
Krzysztof Parzyszek | 7c9c058 | 2017-10-13 19:02:59 +0000 | [diff] [blame] | 150 | FunctionPass *createHexagonConstExtenders(); |
Krzysztof Parzyszek | 167d918 | 2016-07-28 20:01:59 +0000 | [diff] [blame] | 151 | FunctionPass *createHexagonConstPropagationPass(); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 152 | FunctionPass *createHexagonCopyToCombine(); |
Krzysztof Parzyszek | fb33824 | 2015-10-06 15:49:14 +0000 | [diff] [blame] | 153 | FunctionPass *createHexagonEarlyIfConversion(); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 154 | FunctionPass *createHexagonFixupHwLoops(); |
| 155 | FunctionPass *createHexagonGenExtract(); |
Krzysztof Parzyszek | 21b53a5 | 2015-07-08 14:47:34 +0000 | [diff] [blame] | 156 | FunctionPass *createHexagonGenInsert(); |
Krzysztof Parzyszek | 9217220 | 2015-07-20 21:23:25 +0000 | [diff] [blame] | 157 | FunctionPass *createHexagonGenMux(); |
Krzysztof Parzyszek | 7587447 | 2015-07-14 19:30:21 +0000 | [diff] [blame] | 158 | FunctionPass *createHexagonGenPredicate(); |
Colin LeMahieu | 56efafc | 2015-06-15 19:05:35 +0000 | [diff] [blame] | 159 | FunctionPass *createHexagonHardwareLoops(); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 160 | FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM, |
| 161 | CodeGenOpt::Level OptLevel); |
Krzysztof Parzyszek | ced9941 | 2015-10-20 22:57:13 +0000 | [diff] [blame] | 162 | FunctionPass *createHexagonLoopRescheduling(); |
Colin LeMahieu | 56efafc | 2015-06-15 19:05:35 +0000 | [diff] [blame] | 163 | FunctionPass *createHexagonNewValueJump(); |
Krzysztof Parzyszek | 055c5fd | 2015-10-19 19:10:48 +0000 | [diff] [blame] | 164 | FunctionPass *createHexagonOptimizeSZextends(); |
Krzysztof Parzyszek | f5cbac9 | 2016-04-29 15:49:13 +0000 | [diff] [blame] | 165 | FunctionPass *createHexagonOptAddrMode(); |
Krzysztof Parzyszek | 39a979c | 2018-08-17 14:24:24 +0000 | [diff] [blame] | 166 | FunctionPass *createHexagonPacketizer(bool Minimal); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 167 | FunctionPass *createHexagonPeephole(); |
Krzysztof Parzyszek | 1279881 | 2016-01-12 19:09:01 +0000 | [diff] [blame] | 168 | FunctionPass *createHexagonRDFOpt(); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 169 | FunctionPass *createHexagonSplitConst32AndConst64(); |
Krzysztof Parzyszek | a7c5f04 | 2015-10-16 20:38:54 +0000 | [diff] [blame] | 170 | FunctionPass *createHexagonSplitDoubleRegs(); |
Krzysztof Parzyszek | 5b7dd0c | 2015-10-16 19:43:56 +0000 | [diff] [blame] | 171 | FunctionPass *createHexagonStoreWidening(); |
Ron Lieberman | 8123b96 | 2016-08-01 19:36:39 +0000 | [diff] [blame] | 172 | FunctionPass *createHexagonVectorPrint(); |
Krzysztof Parzyszek | 95614ac | 2018-01-26 21:17:14 +0000 | [diff] [blame] | 173 | FunctionPass *createHexagonVExtract(); |
Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 174 | } // end namespace llvm; |
Krzysztof Parzyszek | c05dff1 | 2015-03-31 13:35:12 +0000 | [diff] [blame] | 175 | |
Rafael Espindola | 8c34dd8 | 2016-05-18 22:04:49 +0000 | [diff] [blame] | 176 | static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) { |
| 177 | if (!RM.hasValue()) |
| 178 | return Reloc::Static; |
| 179 | return *RM; |
| 180 | } |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 181 | |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 182 | extern "C" void LLVMInitializeHexagonTarget() { |
| 183 | // Register the target. |
| 184 | RegisterTargetMachine<HexagonTargetMachine> X(getTheHexagonTarget()); |
Krzysztof Parzyszek | de2ac17 | 2017-06-13 16:07:36 +0000 | [diff] [blame] | 185 | |
| 186 | PassRegistry &PR = *PassRegistry::getPassRegistry(); |
Krzysztof Parzyszek | b404fae | 2018-02-20 14:29:43 +0000 | [diff] [blame] | 187 | initializeHexagonBitSimplifyPass(PR); |
Krzysztof Parzyszek | 7c9c058 | 2017-10-13 19:02:59 +0000 | [diff] [blame] | 188 | initializeHexagonConstExtendersPass(PR); |
Krzysztof Parzyszek | 96690ce | 2018-02-23 20:33:26 +0000 | [diff] [blame] | 189 | initializeHexagonConstPropagationPass(PR); |
Krzysztof Parzyszek | 1966fd7 | 2017-08-09 21:22:05 +0000 | [diff] [blame] | 190 | initializeHexagonEarlyIfConversionPass(PR); |
Krzysztof Parzyszek | de2ac17 | 2017-06-13 16:07:36 +0000 | [diff] [blame] | 191 | initializeHexagonGenMuxPass(PR); |
Krzysztof Parzyszek | 3818aea | 2017-10-20 16:56:33 +0000 | [diff] [blame] | 192 | initializeHexagonHardwareLoopsPass(PR); |
Krzysztof Parzyszek | df4a05d | 2017-07-10 18:38:52 +0000 | [diff] [blame] | 193 | initializeHexagonLoopIdiomRecognizePass(PR); |
Pranav Bhandarkar | 931d0b7 | 2017-09-21 21:48:23 +0000 | [diff] [blame] | 194 | initializeHexagonVectorLoopCarriedReusePass(PR); |
Krzysztof Parzyszek | 5ddd2e5 | 2017-06-27 18:37:16 +0000 | [diff] [blame] | 195 | initializeHexagonNewValueJumpPass(PR); |
Krzysztof Parzyszek | df4a05d | 2017-07-10 18:38:52 +0000 | [diff] [blame] | 196 | initializeHexagonOptAddrModePass(PR); |
| 197 | initializeHexagonPacketizerPass(PR); |
Krzysztof Parzyszek | bef1c56 | 2017-10-30 14:11:52 +0000 | [diff] [blame] | 198 | initializeHexagonRDFOptPass(PR); |
Krzysztof Parzyszek | effcc2f | 2018-05-04 15:04:48 +0000 | [diff] [blame] | 199 | initializeHexagonSplitDoubleRegsPass(PR); |
Krzysztof Parzyszek | 95614ac | 2018-01-26 21:17:14 +0000 | [diff] [blame] | 200 | initializeHexagonVExtractPass(PR); |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 201 | } |
| 202 | |
Daniel Sanders | 3e5de88 | 2015-06-11 19:41:26 +0000 | [diff] [blame] | 203 | HexagonTargetMachine::HexagonTargetMachine(const Target &T, const Triple &TT, |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 204 | StringRef CPU, StringRef FS, |
Craig Topper | b545408 | 2012-03-17 09:24:09 +0000 | [diff] [blame] | 205 | const TargetOptions &Options, |
Rafael Espindola | 8c34dd8 | 2016-05-18 22:04:49 +0000 | [diff] [blame] | 206 | Optional<Reloc::Model> RM, |
Rafael Espindola | 79e238a | 2017-08-03 02:16:21 +0000 | [diff] [blame] | 207 | Optional<CodeModel::Model> CM, |
| 208 | CodeGenOpt::Level OL, bool JIT) |
Krzysztof Parzyszek | e599643 | 2016-02-12 14:47:38 +0000 | [diff] [blame] | 209 | // Specify the vector alignment explicitly. For v512x1, the calculated |
| 210 | // alignment would be 512*alignment(i1), which is 512 bytes, instead of |
| 211 | // the required minimum of 64 bytes. |
Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 212 | : LLVMTargetMachine( |
Rafael Espindola | 79e238a | 2017-08-03 02:16:21 +0000 | [diff] [blame] | 213 | T, |
| 214 | "e-m:e-p:32:32:32-a:0-n16:32-" |
| 215 | "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-" |
| 216 | "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048", |
| 217 | TT, CPU, FS, Options, getEffectiveRelocModel(RM), |
David Green | ca29c27 | 2018-12-07 12:10:23 +0000 | [diff] [blame] | 218 | getEffectiveCodeModel(CM, CodeModel::Small), |
| 219 | (HexagonNoOpt ? CodeGenOpt::None : OL)), |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 220 | TLOF(make_unique<HexagonTargetObjectFile>()) { |
Krzysztof Parzyszek | 951fb36 | 2016-08-24 22:27:36 +0000 | [diff] [blame] | 221 | initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry()); |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 222 | initAsmInfo(); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 223 | } |
| 224 | |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 225 | const HexagonSubtarget * |
| 226 | HexagonTargetMachine::getSubtargetImpl(const Function &F) const { |
Reid Kleckner | b518054 | 2017-03-21 16:57:19 +0000 | [diff] [blame] | 227 | AttributeList FnAttrs = F.getAttributes(); |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 228 | Attribute CPUAttr = |
Reid Kleckner | b518054 | 2017-03-21 16:57:19 +0000 | [diff] [blame] | 229 | FnAttrs.getAttribute(AttributeList::FunctionIndex, "target-cpu"); |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 230 | Attribute FSAttr = |
Reid Kleckner | b518054 | 2017-03-21 16:57:19 +0000 | [diff] [blame] | 231 | FnAttrs.getAttribute(AttributeList::FunctionIndex, "target-features"); |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 232 | |
| 233 | std::string CPU = !CPUAttr.hasAttribute(Attribute::None) |
| 234 | ? CPUAttr.getValueAsString().str() |
| 235 | : TargetCPU; |
| 236 | std::string FS = !FSAttr.hasAttribute(Attribute::None) |
| 237 | ? FSAttr.getValueAsString().str() |
| 238 | : TargetFS; |
| 239 | |
| 240 | auto &I = SubtargetMap[CPU + FS]; |
| 241 | if (!I) { |
| 242 | // This needs to be done before we create a new subtarget since any |
| 243 | // creation will depend on the TM and the code generation flags on the |
| 244 | // function that reside in TargetOptions. |
| 245 | resetTargetOptions(F); |
| 246 | I = llvm::make_unique<HexagonSubtarget>(TargetTriple, CPU, FS, *this); |
| 247 | } |
| 248 | return I.get(); |
| 249 | } |
| 250 | |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 251 | void HexagonTargetMachine::adjustPassManager(PassManagerBuilder &PMB) { |
| 252 | PMB.addExtension( |
| 253 | PassManagerBuilder::EP_LateLoopOptimizations, |
| 254 | [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) { |
| 255 | PM.add(createHexagonLoopIdiomPass()); |
| 256 | }); |
Pranav Bhandarkar | 931d0b7 | 2017-09-21 21:48:23 +0000 | [diff] [blame] | 257 | PMB.addExtension( |
| 258 | PassManagerBuilder::EP_LoopOptimizerEnd, |
| 259 | [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) { |
| 260 | PM.add(createHexagonVectorLoopCarriedReusePass()); |
| 261 | }); |
Krzysztof Parzyszek | c8b9438 | 2017-01-26 21:41:10 +0000 | [diff] [blame] | 262 | } |
| 263 | |
Sanjoy Das | 26d11ca | 2017-12-22 18:21:59 +0000 | [diff] [blame] | 264 | TargetTransformInfo |
| 265 | HexagonTargetMachine::getTargetTransformInfo(const Function &F) { |
| 266 | return TargetTransformInfo(HexagonTTIImpl(this, F)); |
Krzysztof Parzyszek | 73e66f3 | 2015-08-05 18:35:37 +0000 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | |
Reid Kleckner | 357600e | 2014-11-20 23:37:18 +0000 | [diff] [blame] | 270 | HexagonTargetMachine::~HexagonTargetMachine() {} |
| 271 | |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 272 | namespace { |
| 273 | /// Hexagon Code Generator Pass Configuration Options. |
| 274 | class HexagonPassConfig : public TargetPassConfig { |
| 275 | public: |
Matthias Braun | 5e394c3 | 2017-05-30 21:36:41 +0000 | [diff] [blame] | 276 | HexagonPassConfig(HexagonTargetMachine &TM, PassManagerBase &PM) |
Krzysztof Parzyszek | d0f8e1c | 2016-05-27 20:48:39 +0000 | [diff] [blame] | 277 | : TargetPassConfig(TM, PM) {} |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 278 | |
| 279 | HexagonTargetMachine &getHexagonTargetMachine() const { |
| 280 | return getTM<HexagonTargetMachine>(); |
| 281 | } |
| 282 | |
Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 283 | ScheduleDAGInstrs * |
| 284 | createMachineScheduler(MachineSchedContext *C) const override { |
Andrew Trick | 978674b | 2013-09-20 05:14:41 +0000 | [diff] [blame] | 285 | return createVLIWMachineSched(C); |
| 286 | } |
| 287 | |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 288 | void addIRPasses() override; |
Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 289 | bool addInstSelector() override; |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 290 | void addPreRegAlloc() override; |
| 291 | void addPostRegAlloc() override; |
| 292 | void addPreSched2() override; |
| 293 | void addPreEmitPass() override; |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 294 | }; |
| 295 | } // namespace |
| 296 | |
Andrew Trick | f8ea108 | 2012-02-04 02:56:59 +0000 | [diff] [blame] | 297 | TargetPassConfig *HexagonTargetMachine::createPassConfig(PassManagerBase &PM) { |
Matthias Braun | 5e394c3 | 2017-05-30 21:36:41 +0000 | [diff] [blame] | 298 | return new HexagonPassConfig(*this, PM); |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 299 | } |
| 300 | |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 301 | void HexagonPassConfig::addIRPasses() { |
| 302 | TargetPassConfig::addIRPasses(); |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 303 | bool NoOpt = (getOptLevel() == CodeGenOpt::None); |
Krzysztof Parzyszek | feaf7b8 | 2015-07-09 14:51:21 +0000 | [diff] [blame] | 304 | |
Krzysztof Parzyszek | cf3ad58 | 2018-01-24 17:48:11 +0000 | [diff] [blame] | 305 | if (!NoOpt) { |
| 306 | addPass(createConstantPropagationPass()); |
| 307 | addPass(createDeadCodeEliminationPass()); |
| 308 | } |
| 309 | |
Francis Visoiu Mistrih | 8b61764 | 2017-05-18 17:21:13 +0000 | [diff] [blame] | 310 | addPass(createAtomicExpandPass()); |
Krzysztof Parzyszek | d91a9e2 | 2018-08-02 22:17:53 +0000 | [diff] [blame] | 311 | |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 312 | if (!NoOpt) { |
Krzysztof Parzyszek | d91a9e2 | 2018-08-02 22:17:53 +0000 | [diff] [blame] | 313 | if (EnableInitialCFGCleanup) |
| 314 | addPass(createCFGSimplificationPass(1, true, true, false, true)); |
Krzysztof Parzyszek | d3d0a4b | 2016-07-22 14:22:43 +0000 | [diff] [blame] | 315 | if (EnableLoopPrefetch) |
| 316 | addPass(createLoopDataPrefetchPass()); |
Krzysztof Parzyszek | a0ecf07 | 2015-07-14 17:07:24 +0000 | [diff] [blame] | 317 | if (EnableCommGEP) |
| 318 | addPass(createHexagonCommonGEP()); |
| 319 | // Replace certain combinations of shifts and ands with extracts. |
| 320 | if (EnableGenExtract) |
| 321 | addPass(createHexagonGenExtract()); |
| 322 | } |
Krzysztof Parzyszek | 79b2433 | 2015-07-08 19:22:28 +0000 | [diff] [blame] | 323 | } |
| 324 | |
Andrew Trick | ccb6736 | 2012-02-03 05:12:41 +0000 | [diff] [blame] | 325 | bool HexagonPassConfig::addInstSelector() { |
Bill Wendling | a3cd350 | 2013-06-19 21:36:55 +0000 | [diff] [blame] | 326 | HexagonTargetMachine &TM = getHexagonTargetMachine(); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 327 | bool NoOpt = (getOptLevel() == CodeGenOpt::None); |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 328 | |
Krzysztof Parzyszek | 055c5fd | 2015-10-19 19:10:48 +0000 | [diff] [blame] | 329 | if (!NoOpt) |
| 330 | addPass(createHexagonOptimizeSZextends()); |
| 331 | |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 332 | addPass(createHexagonISelDag(TM, getOptLevel())); |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 333 | |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 334 | if (!NoOpt) { |
Krzysztof Parzyszek | 95614ac | 2018-01-26 21:17:14 +0000 | [diff] [blame] | 335 | if (EnableVExtractOpt) |
| 336 | addPass(createHexagonVExtract()); |
Krzysztof Parzyszek | 7587447 | 2015-07-14 19:30:21 +0000 | [diff] [blame] | 337 | // Create logical operations on predicate registers. |
| 338 | if (EnableGenPred) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 339 | addPass(createHexagonGenPredicate()); |
Krzysztof Parzyszek | ced9941 | 2015-10-20 22:57:13 +0000 | [diff] [blame] | 340 | // Rotate loops to expose bit-simplification opportunities. |
| 341 | if (EnableLoopResched) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 342 | addPass(createHexagonLoopRescheduling()); |
Krzysztof Parzyszek | a7c5f04 | 2015-10-16 20:38:54 +0000 | [diff] [blame] | 343 | // Split double registers. |
| 344 | if (!DisableHSDR) |
| 345 | addPass(createHexagonSplitDoubleRegs()); |
Krzysztof Parzyszek | ced9941 | 2015-10-20 22:57:13 +0000 | [diff] [blame] | 346 | // Bit simplification. |
| 347 | if (EnableBitSimplify) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 348 | addPass(createHexagonBitSimplify()); |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 349 | addPass(createHexagonPeephole()); |
Krzysztof Parzyszek | 167d918 | 2016-07-28 20:01:59 +0000 | [diff] [blame] | 350 | // Constant propagation. |
| 351 | if (!DisableHCP) { |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 352 | addPass(createHexagonConstPropagationPass()); |
| 353 | addPass(&UnreachableMachineBlockElimID); |
Krzysztof Parzyszek | 167d918 | 2016-07-28 20:01:59 +0000 | [diff] [blame] | 354 | } |
Krzysztof Parzyszek | 21b53a5 | 2015-07-08 14:47:34 +0000 | [diff] [blame] | 355 | if (EnableGenInsert) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 356 | addPass(createHexagonGenInsert()); |
Krzysztof Parzyszek | fb33824 | 2015-10-06 15:49:14 +0000 | [diff] [blame] | 357 | if (EnableEarlyIf) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 358 | addPass(createHexagonEarlyIfConversion()); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 359 | } |
Jyotsna Verma | 653d883 | 2013-03-27 11:14:24 +0000 | [diff] [blame] | 360 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 361 | return false; |
| 362 | } |
| 363 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 364 | void HexagonPassConfig::addPreRegAlloc() { |
Krzysztof Parzyszek | 5b7dd0c | 2015-10-16 19:43:56 +0000 | [diff] [blame] | 365 | if (getOptLevel() != CodeGenOpt::None) { |
Krzysztof Parzyszek | 7c9c058 | 2017-10-13 19:02:59 +0000 | [diff] [blame] | 366 | if (EnableCExtOpt) |
| 367 | addPass(createHexagonConstExtenders()); |
Krzysztof Parzyszek | 951fb36 | 2016-08-24 22:27:36 +0000 | [diff] [blame] | 368 | if (EnableExpandCondsets) |
| 369 | insertPass(&RegisterCoalescerID, &HexagonExpandCondsetsID); |
Krzysztof Parzyszek | 5b7dd0c | 2015-10-16 19:43:56 +0000 | [diff] [blame] | 370 | if (!DisableStoreWidening) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 371 | addPass(createHexagonStoreWidening()); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 372 | if (!DisableHardwareLoops) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 373 | addPass(createHexagonHardwareLoops()); |
Krzysztof Parzyszek | 5b7dd0c | 2015-10-16 19:43:56 +0000 | [diff] [blame] | 374 | } |
Brendon Cahoon | 254f889 | 2016-07-29 16:44:44 +0000 | [diff] [blame] | 375 | if (TM->getOptLevel() >= CodeGenOpt::Default) |
| 376 | addPass(&MachinePipelinerID); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 377 | } |
| 378 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 379 | void HexagonPassConfig::addPostRegAlloc() { |
Krzysztof Parzyszek | 1279881 | 2016-01-12 19:09:01 +0000 | [diff] [blame] | 380 | if (getOptLevel() != CodeGenOpt::None) { |
| 381 | if (EnableRDFOpt) |
| 382 | addPass(createHexagonRDFOpt()); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 383 | if (!DisableHexagonCFGOpt) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 384 | addPass(createHexagonCFGOptimizer()); |
Krzysztof Parzyszek | f5cbac9 | 2016-04-29 15:49:13 +0000 | [diff] [blame] | 385 | if (!DisableAModeOpt) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 386 | addPass(createHexagonOptAddrMode()); |
Krzysztof Parzyszek | 1279881 | 2016-01-12 19:09:01 +0000 | [diff] [blame] | 387 | } |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 388 | } |
| 389 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 390 | void HexagonPassConfig::addPreSched2() { |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 391 | addPass(createHexagonCopyToCombine()); |
Jyotsna Verma | 5eb5980 | 2013-05-07 19:53:00 +0000 | [diff] [blame] | 392 | if (getOptLevel() != CodeGenOpt::None) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 393 | addPass(&IfConverterID); |
Eric Christopher | 01f875e | 2015-02-02 22:11:43 +0000 | [diff] [blame] | 394 | addPass(createHexagonSplitConst32AndConst64()); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 395 | } |
| 396 | |
Matthias Braun | 7e37a5f | 2014-12-11 21:26:47 +0000 | [diff] [blame] | 397 | void HexagonPassConfig::addPreEmitPass() { |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 398 | bool NoOpt = (getOptLevel() == CodeGenOpt::None); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 399 | |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 400 | if (!NoOpt) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 401 | addPass(createHexagonNewValueJump()); |
Sirish Pande | 4bd20c5 | 2012-05-12 05:10:30 +0000 | [diff] [blame] | 402 | |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 403 | addPass(createHexagonBranchRelaxation()); |
Krzysztof Parzyszek | 7b59ae2 | 2016-04-19 18:30:18 +0000 | [diff] [blame] | 404 | |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 405 | if (!NoOpt) { |
| 406 | if (!DisableHardwareLoops) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 407 | addPass(createHexagonFixupHwLoops()); |
Krzysztof Parzyszek | 9217220 | 2015-07-20 21:23:25 +0000 | [diff] [blame] | 408 | // Generate MUX from pairs of conditional transfers. |
| 409 | if (EnableGenMux) |
Krzysztof Parzyszek | b1ada4e | 2017-06-08 21:25:36 +0000 | [diff] [blame] | 410 | addPass(createHexagonGenMux()); |
Krzysztof Parzyszek | 59df52c | 2013-05-06 21:25:45 +0000 | [diff] [blame] | 411 | } |
Krzysztof Parzyszek | a8ab1b7 | 2017-12-11 18:57:54 +0000 | [diff] [blame] | 412 | |
Krzysztof Parzyszek | 39a979c | 2018-08-17 14:24:24 +0000 | [diff] [blame] | 413 | // Packetization is mandatory: it handles gather/scatter at all opt levels. |
| 414 | addPass(createHexagonPacketizer(NoOpt), false); |
Krzysztof Parzyszek | a8ab1b7 | 2017-12-11 18:57:54 +0000 | [diff] [blame] | 415 | |
Ron Lieberman | 8123b96 | 2016-08-01 19:36:39 +0000 | [diff] [blame] | 416 | if (EnableVectorPrint) |
| 417 | addPass(createHexagonVectorPrint(), false); |
Krzysztof Parzyszek | db86770 | 2015-10-19 17:46:01 +0000 | [diff] [blame] | 418 | |
| 419 | // Add CFI instructions if necessary. |
| 420 | addPass(createHexagonCallFrameInformation(), false); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 421 | } |