Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_ |
| 19 | |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 20 | #include "base/scoped_arena_allocator.h" |
| 21 | #include "base/scoped_arena_containers.h" |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 22 | #include "induction_var_range.h" |
| 23 | #include "nodes.h" |
| 24 | #include "optimization.h" |
| 25 | |
| 26 | namespace art { |
| 27 | |
Aart Bik | 92685a8 | 2017-03-06 11:13:43 -0800 | [diff] [blame] | 28 | class CompilerDriver; |
| 29 | |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Loop optimizations. Builds a loop hierarchy and applies optimizations to |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 32 | * the detected nested loops, such as removal of dead induction and empty loops |
| 33 | * and inner loop vectorization. |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 34 | */ |
| 35 | class HLoopOptimization : public HOptimization { |
| 36 | public: |
Aart Bik | 92685a8 | 2017-03-06 11:13:43 -0800 | [diff] [blame] | 37 | HLoopOptimization(HGraph* graph, |
| 38 | CompilerDriver* compiler_driver, |
Aart Bik | b92cc33 | 2017-09-06 15:53:17 -0700 | [diff] [blame] | 39 | HInductionVarAnalysis* induction_analysis, |
| 40 | OptimizingCompilerStats* stats); |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 41 | |
| 42 | void Run() OVERRIDE; |
| 43 | |
| 44 | static constexpr const char* kLoopOptimizationPassName = "loop_optimization"; |
| 45 | |
| 46 | private: |
| 47 | /** |
| 48 | * A single loop inside the loop hierarchy representation. |
| 49 | */ |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 50 | struct LoopNode : public ArenaObject<kArenaAllocLoopOptimization> { |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 51 | explicit LoopNode(HLoopInformation* lp_info) |
| 52 | : loop_info(lp_info), |
| 53 | outer(nullptr), |
| 54 | inner(nullptr), |
| 55 | previous(nullptr), |
| 56 | next(nullptr) {} |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 57 | HLoopInformation* loop_info; |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 58 | LoopNode* outer; |
| 59 | LoopNode* inner; |
| 60 | LoopNode* previous; |
| 61 | LoopNode* next; |
| 62 | }; |
| 63 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 64 | /* |
| 65 | * Vectorization restrictions (bit mask). |
| 66 | */ |
| 67 | enum VectorRestrictions { |
Aart Bik | 0148de4 | 2017-09-05 09:25:01 -0700 | [diff] [blame] | 68 | kNone = 0, // no restrictions |
| 69 | kNoMul = 1 << 0, // no multiplication |
| 70 | kNoDiv = 1 << 1, // no division |
| 71 | kNoShift = 1 << 2, // no shift |
| 72 | kNoShr = 1 << 3, // no arithmetic shift right |
| 73 | kNoHiBits = 1 << 4, // "wider" operations cannot bring in higher order bits |
| 74 | kNoSignedHAdd = 1 << 5, // no signed halving add |
| 75 | kNoUnroundedHAdd = 1 << 6, // no unrounded halving add |
| 76 | kNoAbs = 1 << 7, // no absolute value |
| 77 | kNoMinMax = 1 << 8, // no min/max |
| 78 | kNoStringCharAt = 1 << 9, // no StringCharAt |
| 79 | kNoReduction = 1 << 10, // no reduction |
Aart Bik | dbbac8f | 2017-09-01 13:06:08 -0700 | [diff] [blame] | 80 | kNoSAD = 1 << 11, // no sum of absolute differences (SAD) |
Artem Serov | 6e9b137 | 2017-10-05 16:48:30 +0100 | [diff] [blame^] | 81 | kNoWideSAD = 1 << 12, // no sum of absolute differences (SAD) with operand widening |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 82 | }; |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 83 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 84 | /* |
| 85 | * Vectorization mode during synthesis |
| 86 | * (sequential peeling/cleanup loop or vector loop). |
| 87 | */ |
| 88 | enum VectorMode { |
| 89 | kSequential, |
| 90 | kVector |
| 91 | }; |
| 92 | |
| 93 | /* |
| 94 | * Representation of a unit-stride array reference. |
| 95 | */ |
| 96 | struct ArrayReference { |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 97 | ArrayReference(HInstruction* b, HInstruction* o, DataType::Type t, bool l) |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 98 | : base(b), offset(o), type(t), lhs(l) { } |
| 99 | bool operator<(const ArrayReference& other) const { |
| 100 | return |
| 101 | (base < other.base) || |
| 102 | (base == other.base && |
| 103 | (offset < other.offset || (offset == other.offset && |
| 104 | (type < other.type || |
| 105 | (type == other.type && lhs < other.lhs))))); |
| 106 | } |
| 107 | HInstruction* base; // base address |
| 108 | HInstruction* offset; // offset + i |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 109 | DataType::Type type; // component type |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 110 | bool lhs; // def/use |
| 111 | }; |
| 112 | |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 113 | // |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 114 | // Loop setup and traversal. |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 115 | // |
| 116 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 117 | void LocalRun(); |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 118 | void AddLoop(HLoopInformation* loop_info); |
| 119 | void RemoveLoop(LoopNode* node); |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 120 | |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 121 | // Traverses all loops inner to outer to perform simplifications and optimizations. |
| 122 | // Returns true if loops nested inside current loop (node) have changed. |
| 123 | bool TraverseLoopsInnerToOuter(LoopNode* node); |
| 124 | |
| 125 | // |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 126 | // Optimization. |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 127 | // |
| 128 | |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 129 | void SimplifyInduction(LoopNode* node); |
Aart Bik | 482095d | 2016-10-10 15:39:10 -0700 | [diff] [blame] | 130 | void SimplifyBlocks(LoopNode* node); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 131 | |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 132 | // Performs optimizations specific to inner loop (empty loop removal, |
| 133 | // unrolling, vectorization). Returns true if anything changed. |
| 134 | bool OptimizeInnerLoop(LoopNode* node); |
| 135 | |
| 136 | // |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 137 | // Vectorization analysis and synthesis. |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 138 | // |
| 139 | |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 140 | bool ShouldVectorize(LoopNode* node, HBasicBlock* block, int64_t trip_count); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 141 | void Vectorize(LoopNode* node, HBasicBlock* block, HBasicBlock* exit, int64_t trip_count); |
| 142 | void GenerateNewLoop(LoopNode* node, |
| 143 | HBasicBlock* block, |
| 144 | HBasicBlock* new_preheader, |
| 145 | HInstruction* lo, |
| 146 | HInstruction* hi, |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 147 | HInstruction* step, |
| 148 | uint32_t unroll); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 149 | bool VectorizeDef(LoopNode* node, HInstruction* instruction, bool generate_code); |
| 150 | bool VectorizeUse(LoopNode* node, |
| 151 | HInstruction* instruction, |
| 152 | bool generate_code, |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 153 | DataType::Type type, |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 154 | uint64_t restrictions); |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 155 | bool TrySetVectorType(DataType::Type type, /*out*/ uint64_t* restrictions); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 156 | bool TrySetVectorLength(uint32_t length); |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 157 | void GenerateVecInv(HInstruction* org, DataType::Type type); |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 158 | void GenerateVecSub(HInstruction* org, HInstruction* offset); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 159 | void GenerateVecMem(HInstruction* org, |
| 160 | HInstruction* opa, |
| 161 | HInstruction* opb, |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 162 | HInstruction* offset, |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 163 | DataType::Type type); |
Aart Bik | 0148de4 | 2017-09-05 09:25:01 -0700 | [diff] [blame] | 164 | void GenerateVecReductionPhi(HPhi* phi); |
| 165 | void GenerateVecReductionPhiInputs(HPhi* phi, HInstruction* reduction); |
| 166 | HInstruction* ReduceAndExtractIfNeeded(HInstruction* instruction); |
Aart Bik | 304c8a5 | 2017-05-23 11:01:13 -0700 | [diff] [blame] | 167 | void GenerateVecOp(HInstruction* org, |
| 168 | HInstruction* opa, |
| 169 | HInstruction* opb, |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 170 | DataType::Type type, |
Aart Bik | 304c8a5 | 2017-05-23 11:01:13 -0700 | [diff] [blame] | 171 | bool is_unsigned = false); |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 172 | |
Aart Bik | f3e61ee | 2017-04-12 17:09:20 -0700 | [diff] [blame] | 173 | // Vectorization idioms. |
| 174 | bool VectorizeHalvingAddIdiom(LoopNode* node, |
| 175 | HInstruction* instruction, |
| 176 | bool generate_code, |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 177 | DataType::Type type, |
Aart Bik | f3e61ee | 2017-04-12 17:09:20 -0700 | [diff] [blame] | 178 | uint64_t restrictions); |
Aart Bik | dbbac8f | 2017-09-01 13:06:08 -0700 | [diff] [blame] | 179 | bool VectorizeSADIdiom(LoopNode* node, |
| 180 | HInstruction* instruction, |
| 181 | bool generate_code, |
Vladimir Marko | 0ebe0d8 | 2017-09-21 22:50:39 +0100 | [diff] [blame] | 182 | DataType::Type type, |
Aart Bik | dbbac8f | 2017-09-01 13:06:08 -0700 | [diff] [blame] | 183 | uint64_t restrictions); |
Aart Bik | f3e61ee | 2017-04-12 17:09:20 -0700 | [diff] [blame] | 184 | |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 185 | // Vectorization heuristics. |
| 186 | bool IsVectorizationProfitable(int64_t trip_count); |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 187 | void SetPeelingCandidate(const ArrayReference* candidate, int64_t trip_count); |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 188 | uint32_t GetUnrollingFactor(HBasicBlock* block, int64_t trip_count); |
| 189 | |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 190 | // |
Aart Bik | 6b69e0a | 2017-01-11 10:20:43 -0800 | [diff] [blame] | 191 | // Helpers. |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 192 | // |
| 193 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 194 | bool TrySetPhiInduction(HPhi* phi, bool restrict_uses); |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 195 | bool TrySetPhiReduction(HPhi* phi); |
| 196 | |
| 197 | // Detects loop header with a single induction (returned in main_phi), possibly |
| 198 | // other phis for reductions, but no other side effects. Returns true on success. |
| 199 | bool TrySetSimpleLoopHeader(HBasicBlock* block, /*out*/ HPhi** main_phi); |
| 200 | |
Aart Bik | cc42be0 | 2016-10-20 16:14:16 -0700 | [diff] [blame] | 201 | bool IsEmptyBody(HBasicBlock* block); |
Aart Bik | 482095d | 2016-10-10 15:39:10 -0700 | [diff] [blame] | 202 | bool IsOnlyUsedAfterLoop(HLoopInformation* loop_info, |
Aart Bik | 8c4a854 | 2016-10-06 11:36:57 -0700 | [diff] [blame] | 203 | HInstruction* instruction, |
Aart Bik | 6b69e0a | 2017-01-11 10:20:43 -0800 | [diff] [blame] | 204 | bool collect_loop_uses, |
Aart Bik | 8c4a854 | 2016-10-06 11:36:57 -0700 | [diff] [blame] | 205 | /*out*/ int32_t* use_count); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 206 | bool IsUsedOutsideLoop(HLoopInformation* loop_info, |
| 207 | HInstruction* instruction); |
Nicolas Geoffray | 1a0a519 | 2017-06-22 11:56:01 +0100 | [diff] [blame] | 208 | bool TryReplaceWithLastValue(HLoopInformation* loop_info, |
| 209 | HInstruction* instruction, |
| 210 | HBasicBlock* block); |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 211 | bool TryAssignLastValue(HLoopInformation* loop_info, |
| 212 | HInstruction* instruction, |
| 213 | HBasicBlock* block, |
| 214 | bool collect_loop_uses); |
Aart Bik | 6b69e0a | 2017-01-11 10:20:43 -0800 | [diff] [blame] | 215 | void RemoveDeadInstructions(const HInstructionList& list); |
Nicolas Geoffray | 1a0a519 | 2017-06-22 11:56:01 +0100 | [diff] [blame] | 216 | bool CanRemoveCycle(); // Whether the current 'iset_' is removable. |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 217 | |
Aart Bik | 92685a8 | 2017-03-06 11:13:43 -0800 | [diff] [blame] | 218 | // Compiler driver (to query ISA features). |
| 219 | const CompilerDriver* compiler_driver_; |
| 220 | |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 221 | // Range information based on prior induction variable analysis. |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 222 | InductionVarRange induction_range_; |
| 223 | |
| 224 | // Phase-local heap memory allocator for the loop optimizer. Storage obtained |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 225 | // through this allocator is immediately released when the loop optimizer is done. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 226 | ScopedArenaAllocator* loop_allocator_; |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 227 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 228 | // Global heap memory allocator. Used to build HIR. |
| 229 | ArenaAllocator* global_allocator_; |
| 230 | |
Aart Bik | 9620230 | 2016-10-04 17:33:56 -0700 | [diff] [blame] | 231 | // Entries into the loop hierarchy representation. The hierarchy resides |
| 232 | // in phase-local heap memory. |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 233 | LoopNode* top_loop_; |
| 234 | LoopNode* last_loop_; |
| 235 | |
Aart Bik | 8c4a854 | 2016-10-06 11:36:57 -0700 | [diff] [blame] | 236 | // Temporary bookkeeping of a set of instructions. |
| 237 | // Contents reside in phase-local heap memory. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 238 | ScopedArenaSet<HInstruction*>* iset_; |
Aart Bik | 8c4a854 | 2016-10-06 11:36:57 -0700 | [diff] [blame] | 239 | |
Aart Bik | b29f684 | 2017-07-28 15:58:41 -0700 | [diff] [blame] | 240 | // Temporary bookkeeping of reduction instructions. Mapping is two-fold: |
| 241 | // (1) reductions in the loop-body are mapped back to their phi definition, |
| 242 | // (2) phi definitions are mapped to their initial value (updated during |
| 243 | // code generation to feed the proper values into the new chain). |
| 244 | // Contents reside in phase-local heap memory. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 245 | ScopedArenaSafeMap<HInstruction*, HInstruction*>* reductions_; |
Aart Bik | 482095d | 2016-10-10 15:39:10 -0700 | [diff] [blame] | 246 | |
Aart Bik | df7822e | 2016-12-06 10:05:30 -0800 | [diff] [blame] | 247 | // Flag that tracks if any simplifications have occurred. |
| 248 | bool simplified_; |
| 249 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 250 | // Number of "lanes" for selected packed type. |
| 251 | uint32_t vector_length_; |
| 252 | |
| 253 | // Set of array references in the vector loop. |
| 254 | // Contents reside in phase-local heap memory. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 255 | ScopedArenaSet<ArrayReference>* vector_refs_; |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 256 | |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 257 | // Dynamic loop peeling candidate for alignment. |
| 258 | const ArrayReference* vector_peeling_candidate_; |
| 259 | |
| 260 | // Dynamic data dependence test of the form a != b. |
| 261 | HInstruction* vector_runtime_test_a_; |
| 262 | HInstruction* vector_runtime_test_b_; |
| 263 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 264 | // Mapping used during vectorization synthesis for both the scalar peeling/cleanup |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 265 | // loop (mode is kSequential) and the actual vector loop (mode is kVector). The data |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 266 | // structure maps original instructions into the new instructions. |
| 267 | // Contents reside in phase-local heap memory. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 268 | ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_map_; |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 269 | |
Aart Bik | 0148de4 | 2017-09-05 09:25:01 -0700 | [diff] [blame] | 270 | // Permanent mapping used during vectorization synthesis. |
| 271 | // Contents reside in phase-local heap memory. |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 272 | ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_permanent_map_; |
Aart Bik | 0148de4 | 2017-09-05 09:25:01 -0700 | [diff] [blame] | 273 | |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 274 | // Temporary vectorization bookkeeping. |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 275 | VectorMode vector_mode_; // synthesis mode |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 276 | HBasicBlock* vector_preheader_; // preheader of the new loop |
| 277 | HBasicBlock* vector_header_; // header of the new loop |
| 278 | HBasicBlock* vector_body_; // body of the new loop |
Aart Bik | 14a68b4 | 2017-06-08 14:06:58 -0700 | [diff] [blame] | 279 | HInstruction* vector_index_; // normalized index of the new loop |
Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 280 | |
Aart Bik | 281c681 | 2016-08-26 11:31:48 -0700 | [diff] [blame] | 281 | friend class LoopOptimizationTest; |
| 282 | |
| 283 | DISALLOW_COPY_AND_ASSIGN(HLoopOptimization); |
| 284 | }; |
| 285 | |
| 286 | } // namespace art |
| 287 | |
| 288 | #endif // ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_ |