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