blob: b17861648f95c85296cc899f88dff45f55e108e9 [file] [log] [blame]
Aart Bik281c6812016-08-26 11:31:48 -07001/*
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 Markoca6fff82017-10-03 14:49:14 +010020#include "base/scoped_arena_allocator.h"
21#include "base/scoped_arena_containers.h"
Aart Bik281c6812016-08-26 11:31:48 -070022#include "induction_var_range.h"
Artem Serov121f2032017-10-23 19:19:06 +010023#include "loop_analysis.h"
Aart Bik281c6812016-08-26 11:31:48 -070024#include "nodes.h"
25#include "optimization.h"
Artem Serov121f2032017-10-23 19:19:06 +010026#include "superblock_cloner.h"
Aart Bik281c6812016-08-26 11:31:48 -070027
Vladimir Marko0a516052019-10-14 13:00:44 +000028namespace art {
Aart Bik281c6812016-08-26 11:31:48 -070029
Vladimir Markoa0431112018-06-25 09:32:54 +010030class CompilerOptions;
Artem Serovcf43fb62018-02-15 14:43:48 +000031class ArchNoOptsLoopHelper;
Aart Bik92685a82017-03-06 11:13:43 -080032
Aart Bik281c6812016-08-26 11:31:48 -070033/**
34 * Loop optimizations. Builds a loop hierarchy and applies optimizations to
Aart Bikf8f5a162017-02-06 15:35:29 -080035 * the detected nested loops, such as removal of dead induction and empty loops
36 * and inner loop vectorization.
Aart Bik281c6812016-08-26 11:31:48 -070037 */
38class HLoopOptimization : public HOptimization {
39 public:
Aart Bik92685a82017-03-06 11:13:43 -080040 HLoopOptimization(HGraph* graph,
Artem Serovc8150b52019-07-31 18:28:00 +010041 const CodeGenerator& codegen, // Needs info about the target.
Aart Bikb92cc332017-09-06 15:53:17 -070042 HInductionVarAnalysis* induction_analysis,
Aart Bik2ca10eb2017-11-15 15:17:53 -080043 OptimizingCompilerStats* stats,
44 const char* name = kLoopOptimizationPassName);
Aart Bik281c6812016-08-26 11:31:48 -070045
Roland Levillainbbc6e7e2018-08-24 16:58:47 +010046 bool Run() override;
Aart Bik281c6812016-08-26 11:31:48 -070047
48 static constexpr const char* kLoopOptimizationPassName = "loop_optimization";
49
50 private:
51 /**
52 * A single loop inside the loop hierarchy representation.
53 */
Aart Bik96202302016-10-04 17:33:56 -070054 struct LoopNode : public ArenaObject<kArenaAllocLoopOptimization> {
Aart Bik281c6812016-08-26 11:31:48 -070055 explicit LoopNode(HLoopInformation* lp_info)
56 : loop_info(lp_info),
57 outer(nullptr),
58 inner(nullptr),
59 previous(nullptr),
Santiago Aboy Solanes0eca0982022-04-08 18:00:48 +010060 next(nullptr),
61 try_catch_kind(TryCatchKind::kUnknown) {}
62
63 enum class TryCatchKind {
64 kUnknown,
65 // Either if we have a try catch in the loop, or if the loop is inside of an outer try catch,
66 // we set `kHasTryCatch`.
67 kHasTryCatch,
68 kNoTryCatch
69 };
70
Aart Bikf8f5a162017-02-06 15:35:29 -080071 HLoopInformation* loop_info;
Aart Bik281c6812016-08-26 11:31:48 -070072 LoopNode* outer;
73 LoopNode* inner;
74 LoopNode* previous;
75 LoopNode* next;
Santiago Aboy Solanes0eca0982022-04-08 18:00:48 +010076 TryCatchKind try_catch_kind;
Aart Bik281c6812016-08-26 11:31:48 -070077 };
78
Aart Bikf8f5a162017-02-06 15:35:29 -080079 /*
80 * Vectorization restrictions (bit mask).
81 */
82 enum VectorRestrictions {
Aart Bik0148de42017-09-05 09:25:01 -070083 kNone = 0, // no restrictions
84 kNoMul = 1 << 0, // no multiplication
85 kNoDiv = 1 << 1, // no division
86 kNoShift = 1 << 2, // no shift
87 kNoShr = 1 << 3, // no arithmetic shift right
88 kNoHiBits = 1 << 4, // "wider" operations cannot bring in higher order bits
89 kNoSignedHAdd = 1 << 5, // no signed halving add
Artem Serov8ba4de12019-12-04 21:10:23 +000090 kNoUnsignedHAdd = 1 << 6, // no unsigned halving add
91 kNoUnroundedHAdd = 1 << 7, // no unrounded halving add
92 kNoAbs = 1 << 8, // no absolute value
93 kNoStringCharAt = 1 << 9, // no StringCharAt
94 kNoReduction = 1 << 10, // no reduction
95 kNoSAD = 1 << 11, // no sum of absolute differences (SAD)
96 kNoWideSAD = 1 << 12, // no sum of absolute differences (SAD) with operand widening
97 kNoDotProd = 1 << 13, // no dot product
Aart Bikf8f5a162017-02-06 15:35:29 -080098 };
Aart Bik96202302016-10-04 17:33:56 -070099
Aart Bikf8f5a162017-02-06 15:35:29 -0800100 /*
101 * Vectorization mode during synthesis
102 * (sequential peeling/cleanup loop or vector loop).
103 */
104 enum VectorMode {
105 kSequential,
106 kVector
107 };
108
109 /*
110 * Representation of a unit-stride array reference.
111 */
112 struct ArrayReference {
Aart Bik38a3f212017-10-20 17:02:21 -0700113 ArrayReference(HInstruction* b, HInstruction* o, DataType::Type t, bool l, bool c = false)
114 : base(b), offset(o), type(t), lhs(l), is_string_char_at(c) { }
Aart Bikf8f5a162017-02-06 15:35:29 -0800115 bool operator<(const ArrayReference& other) const {
116 return
117 (base < other.base) ||
118 (base == other.base &&
119 (offset < other.offset || (offset == other.offset &&
120 (type < other.type ||
Aart Bik38a3f212017-10-20 17:02:21 -0700121 (type == other.type &&
122 (lhs < other.lhs ||
123 (lhs == other.lhs &&
124 is_string_char_at < other.is_string_char_at)))))));
Aart Bikf8f5a162017-02-06 15:35:29 -0800125 }
Aart Bik38a3f212017-10-20 17:02:21 -0700126 HInstruction* base; // base address
127 HInstruction* offset; // offset + i
128 DataType::Type type; // component type
129 bool lhs; // def/use
130 bool is_string_char_at; // compressed string read
Aart Bikf8f5a162017-02-06 15:35:29 -0800131 };
132
Aart Bikb29f6842017-07-28 15:58:41 -0700133 //
Aart Bikf8f5a162017-02-06 15:35:29 -0800134 // Loop setup and traversal.
Aart Bikb29f6842017-07-28 15:58:41 -0700135 //
136
Aart Bik24773202018-04-26 10:28:51 -0700137 bool LocalRun();
Aart Bik281c6812016-08-26 11:31:48 -0700138 void AddLoop(HLoopInformation* loop_info);
139 void RemoveLoop(LoopNode* node);
Aart Bik281c6812016-08-26 11:31:48 -0700140
Aart Bikb29f6842017-07-28 15:58:41 -0700141 // Traverses all loops inner to outer to perform simplifications and optimizations.
142 // Returns true if loops nested inside current loop (node) have changed.
143 bool TraverseLoopsInnerToOuter(LoopNode* node);
144
Santiago Aboy Solanes0eca0982022-04-08 18:00:48 +0100145 // Calculates `node`'s `try_catch_kind` and sets it to:
146 // 1) kHasTryCatch if it has try catches (or if it's inside of an outer try catch)
147 // 2) kNoTryCatch otherwise.
148 void CalculateAndSetTryCatchKind(LoopNode* node);
149
Aart Bikb29f6842017-07-28 15:58:41 -0700150 //
Aart Bikf8f5a162017-02-06 15:35:29 -0800151 // Optimization.
Aart Bikb29f6842017-07-28 15:58:41 -0700152 //
153
Aart Bik281c6812016-08-26 11:31:48 -0700154 void SimplifyInduction(LoopNode* node);
Aart Bik482095d2016-10-10 15:39:10 -0700155 void SimplifyBlocks(LoopNode* node);
Aart Bikf8f5a162017-02-06 15:35:29 -0800156
Artem Serov121f2032017-10-23 19:19:06 +0100157 // Performs optimizations specific to inner loop with finite header logic (empty loop removal,
Aart Bikb29f6842017-07-28 15:58:41 -0700158 // unrolling, vectorization). Returns true if anything changed.
Artem Serov121f2032017-10-23 19:19:06 +0100159 bool TryOptimizeInnerLoopFinite(LoopNode* node);
160
161 // Performs optimizations specific to inner loop. Returns true if anything changed.
Aart Bikb29f6842017-07-28 15:58:41 -0700162 bool OptimizeInnerLoop(LoopNode* node);
163
Artem Serov121f2032017-10-23 19:19:06 +0100164 // Tries to apply loop unrolling for branch penalty reduction and better instruction scheduling
Artem Serov0e329082018-06-12 10:23:27 +0100165 // opportunities. Returns whether transformation happened. 'generate_code' determines whether the
166 // optimization should be actually applied.
167 bool TryUnrollingForBranchPenaltyReduction(LoopAnalysisInfo* analysis_info,
168 bool generate_code = true);
Artem Serov121f2032017-10-23 19:19:06 +0100169
Artem Serov72411e62017-10-19 16:18:07 +0100170 // Tries to apply loop peeling for loop invariant exits elimination. Returns whether
Artem Serov0e329082018-06-12 10:23:27 +0100171 // transformation happened. 'generate_code' determines whether the optimization should be
172 // actually applied.
173 bool TryPeelingForLoopInvariantExitsElimination(LoopAnalysisInfo* analysis_info,
174 bool generate_code = true);
175
Artem Serov18ba1da2018-05-16 19:06:32 +0100176 // Tries to perform whole loop unrolling for a small loop with a small trip count to eliminate
177 // the loop check overhead and to have more opportunities for inter-iteration optimizations.
178 // Returns whether transformation happened. 'generate_code' determines whether the optimization
179 // should be actually applied.
180 bool TryFullUnrolling(LoopAnalysisInfo* analysis_info, bool generate_code = true);
181
Nicolas Geoffray8f6b99f2021-09-28 17:51:17 +0000182 // Tries to apply scalar loop peeling and unrolling.
183 bool TryPeelingAndUnrolling(LoopNode* node);
Artem Serov72411e62017-10-19 16:18:07 +0100184
Aart Bikb29f6842017-07-28 15:58:41 -0700185 //
Aart Bikf8f5a162017-02-06 15:35:29 -0800186 // Vectorization analysis and synthesis.
Aart Bikb29f6842017-07-28 15:58:41 -0700187 //
188
Aart Bik14a68b42017-06-08 14:06:58 -0700189 bool ShouldVectorize(LoopNode* node, HBasicBlock* block, int64_t trip_count);
Aart Bikf8f5a162017-02-06 15:35:29 -0800190 void Vectorize(LoopNode* node, HBasicBlock* block, HBasicBlock* exit, int64_t trip_count);
191 void GenerateNewLoop(LoopNode* node,
192 HBasicBlock* block,
193 HBasicBlock* new_preheader,
194 HInstruction* lo,
195 HInstruction* hi,
Aart Bik14a68b42017-06-08 14:06:58 -0700196 HInstruction* step,
197 uint32_t unroll);
Aart Bikf8f5a162017-02-06 15:35:29 -0800198 bool VectorizeDef(LoopNode* node, HInstruction* instruction, bool generate_code);
199 bool VectorizeUse(LoopNode* node,
200 HInstruction* instruction,
201 bool generate_code,
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100202 DataType::Type type,
Aart Bikf8f5a162017-02-06 15:35:29 -0800203 uint64_t restrictions);
Aart Bik38a3f212017-10-20 17:02:21 -0700204 uint32_t GetVectorSizeInBytes();
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100205 bool TrySetVectorType(DataType::Type type, /*out*/ uint64_t* restrictions);
Artem Serovc8150b52019-07-31 18:28:00 +0100206 bool TrySetVectorLengthImpl(uint32_t length);
207
208 bool TrySetVectorLength(DataType::Type type, uint32_t length) {
209 bool res = TrySetVectorLengthImpl(length);
210 // Currently the vectorizer supports only the mode when full SIMD registers are used.
Santiago Aboy Solanes872ec722022-02-18 14:10:25 +0000211 DCHECK_IMPLIES(res, DataType::Size(type) * length == GetVectorSizeInBytes());
Artem Serovc8150b52019-07-31 18:28:00 +0100212 return res;
213 }
214
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100215 void GenerateVecInv(HInstruction* org, DataType::Type type);
Aart Bik14a68b42017-06-08 14:06:58 -0700216 void GenerateVecSub(HInstruction* org, HInstruction* offset);
Aart Bikf8f5a162017-02-06 15:35:29 -0800217 void GenerateVecMem(HInstruction* org,
218 HInstruction* opa,
219 HInstruction* opb,
Aart Bik14a68b42017-06-08 14:06:58 -0700220 HInstruction* offset,
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100221 DataType::Type type);
Aart Bik0148de42017-09-05 09:25:01 -0700222 void GenerateVecReductionPhi(HPhi* phi);
223 void GenerateVecReductionPhiInputs(HPhi* phi, HInstruction* reduction);
224 HInstruction* ReduceAndExtractIfNeeded(HInstruction* instruction);
Aart Bik304c8a52017-05-23 11:01:13 -0700225 void GenerateVecOp(HInstruction* org,
226 HInstruction* opa,
227 HInstruction* opb,
Aart Bik3f08e9b2018-05-01 13:42:03 -0700228 DataType::Type type);
Aart Bik281c6812016-08-26 11:31:48 -0700229
Aart Bikf3e61ee2017-04-12 17:09:20 -0700230 // Vectorization idioms.
Aart Bik29aa0822018-03-08 11:28:00 -0800231 bool VectorizeSaturationIdiom(LoopNode* node,
232 HInstruction* instruction,
233 bool generate_code,
234 DataType::Type type,
235 uint64_t restrictions);
Aart Bikf3e61ee2017-04-12 17:09:20 -0700236 bool VectorizeHalvingAddIdiom(LoopNode* node,
237 HInstruction* instruction,
238 bool generate_code,
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100239 DataType::Type type,
Aart Bikf3e61ee2017-04-12 17:09:20 -0700240 uint64_t restrictions);
Aart Bikdbbac8f2017-09-01 13:06:08 -0700241 bool VectorizeSADIdiom(LoopNode* node,
242 HInstruction* instruction,
243 bool generate_code,
Vladimir Marko0ebe0d82017-09-21 22:50:39 +0100244 DataType::Type type,
Aart Bikdbbac8f2017-09-01 13:06:08 -0700245 uint64_t restrictions);
Artem Serovaaac0e32018-08-07 00:52:22 +0100246 bool VectorizeDotProdIdiom(LoopNode* node,
247 HInstruction* instruction,
248 bool generate_code,
249 DataType::Type type,
250 uint64_t restrictions);
Aart Bikf3e61ee2017-04-12 17:09:20 -0700251
Aart Bik14a68b42017-06-08 14:06:58 -0700252 // Vectorization heuristics.
Aart Bik38a3f212017-10-20 17:02:21 -0700253 Alignment ComputeAlignment(HInstruction* offset,
254 DataType::Type type,
255 bool is_string_char_at,
256 uint32_t peeling = 0);
Artem Serov55ab7e82020-04-27 21:02:28 +0100257 void SetAlignmentStrategy(const ScopedArenaVector<uint32_t>& peeling_votes,
Aart Bik38a3f212017-10-20 17:02:21 -0700258 const ArrayReference* peeling_candidate);
259 uint32_t MaxNumberPeeled();
Aart Bik14a68b42017-06-08 14:06:58 -0700260 bool IsVectorizationProfitable(int64_t trip_count);
Aart Bik14a68b42017-06-08 14:06:58 -0700261
Aart Bikb29f6842017-07-28 15:58:41 -0700262 //
Aart Bik6b69e0a2017-01-11 10:20:43 -0800263 // Helpers.
Aart Bikb29f6842017-07-28 15:58:41 -0700264 //
265
Aart Bikf8f5a162017-02-06 15:35:29 -0800266 bool TrySetPhiInduction(HPhi* phi, bool restrict_uses);
Aart Bikb29f6842017-07-28 15:58:41 -0700267 bool TrySetPhiReduction(HPhi* phi);
268
269 // Detects loop header with a single induction (returned in main_phi), possibly
270 // other phis for reductions, but no other side effects. Returns true on success.
271 bool TrySetSimpleLoopHeader(HBasicBlock* block, /*out*/ HPhi** main_phi);
272
Aart Bikcc42be02016-10-20 16:14:16 -0700273 bool IsEmptyBody(HBasicBlock* block);
Aart Bik482095d2016-10-10 15:39:10 -0700274 bool IsOnlyUsedAfterLoop(HLoopInformation* loop_info,
Aart Bik8c4a8542016-10-06 11:36:57 -0700275 HInstruction* instruction,
Aart Bik6b69e0a2017-01-11 10:20:43 -0800276 bool collect_loop_uses,
Aart Bik38a3f212017-10-20 17:02:21 -0700277 /*out*/ uint32_t* use_count);
Aart Bikf8f5a162017-02-06 15:35:29 -0800278 bool IsUsedOutsideLoop(HLoopInformation* loop_info,
279 HInstruction* instruction);
Nicolas Geoffray1a0a5192017-06-22 11:56:01 +0100280 bool TryReplaceWithLastValue(HLoopInformation* loop_info,
281 HInstruction* instruction,
282 HBasicBlock* block);
Aart Bikf8f5a162017-02-06 15:35:29 -0800283 bool TryAssignLastValue(HLoopInformation* loop_info,
284 HInstruction* instruction,
285 HBasicBlock* block,
286 bool collect_loop_uses);
Aart Bik6b69e0a2017-01-11 10:20:43 -0800287 void RemoveDeadInstructions(const HInstructionList& list);
Nicolas Geoffray1a0a5192017-06-22 11:56:01 +0100288 bool CanRemoveCycle(); // Whether the current 'iset_' is removable.
Aart Bik281c6812016-08-26 11:31:48 -0700289
Artem Serov8ba4de12019-12-04 21:10:23 +0000290 bool IsInPredicatedVectorizationMode() const { return predicated_vectorization_mode_; }
291
Vladimir Markoa0431112018-06-25 09:32:54 +0100292 // Compiler options (to query ISA features).
293 const CompilerOptions* compiler_options_;
Aart Bik92685a82017-03-06 11:13:43 -0800294
Artem Serovc8150b52019-07-31 18:28:00 +0100295 // Cached target SIMD vector register size in bytes.
296 const size_t simd_register_size_;
297
Aart Bik96202302016-10-04 17:33:56 -0700298 // Range information based on prior induction variable analysis.
Aart Bik281c6812016-08-26 11:31:48 -0700299 InductionVarRange induction_range_;
300
301 // Phase-local heap memory allocator for the loop optimizer. Storage obtained
Aart Bik96202302016-10-04 17:33:56 -0700302 // through this allocator is immediately released when the loop optimizer is done.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100303 ScopedArenaAllocator* loop_allocator_;
Aart Bik281c6812016-08-26 11:31:48 -0700304
Aart Bikf8f5a162017-02-06 15:35:29 -0800305 // Global heap memory allocator. Used to build HIR.
306 ArenaAllocator* global_allocator_;
307
Aart Bik96202302016-10-04 17:33:56 -0700308 // Entries into the loop hierarchy representation. The hierarchy resides
309 // in phase-local heap memory.
Aart Bik281c6812016-08-26 11:31:48 -0700310 LoopNode* top_loop_;
311 LoopNode* last_loop_;
312
Aart Bik8c4a8542016-10-06 11:36:57 -0700313 // Temporary bookkeeping of a set of instructions.
314 // Contents reside in phase-local heap memory.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100315 ScopedArenaSet<HInstruction*>* iset_;
Aart Bik8c4a8542016-10-06 11:36:57 -0700316
Aart Bikb29f6842017-07-28 15:58:41 -0700317 // Temporary bookkeeping of reduction instructions. Mapping is two-fold:
318 // (1) reductions in the loop-body are mapped back to their phi definition,
319 // (2) phi definitions are mapped to their initial value (updated during
320 // code generation to feed the proper values into the new chain).
321 // Contents reside in phase-local heap memory.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100322 ScopedArenaSafeMap<HInstruction*, HInstruction*>* reductions_;
Aart Bik482095d2016-10-10 15:39:10 -0700323
Aart Bikdf7822e2016-12-06 10:05:30 -0800324 // Flag that tracks if any simplifications have occurred.
325 bool simplified_;
326
Artem Serov8ba4de12019-12-04 21:10:23 +0000327 // Whether to use predicated loop vectorization (e.g. for arm64 SVE target).
328 bool predicated_vectorization_mode_;
329
Aart Bikf8f5a162017-02-06 15:35:29 -0800330 // Number of "lanes" for selected packed type.
331 uint32_t vector_length_;
332
333 // Set of array references in the vector loop.
334 // Contents reside in phase-local heap memory.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100335 ScopedArenaSet<ArrayReference>* vector_refs_;
Aart Bikf8f5a162017-02-06 15:35:29 -0800336
Aart Bik38a3f212017-10-20 17:02:21 -0700337 // Static or dynamic loop peeling for alignment.
338 uint32_t vector_static_peeling_factor_;
339 const ArrayReference* vector_dynamic_peeling_candidate_;
Aart Bik14a68b42017-06-08 14:06:58 -0700340
341 // Dynamic data dependence test of the form a != b.
342 HInstruction* vector_runtime_test_a_;
343 HInstruction* vector_runtime_test_b_;
344
Aart Bikf8f5a162017-02-06 15:35:29 -0800345 // Mapping used during vectorization synthesis for both the scalar peeling/cleanup
Aart Bik14a68b42017-06-08 14:06:58 -0700346 // loop (mode is kSequential) and the actual vector loop (mode is kVector). The data
Aart Bikf8f5a162017-02-06 15:35:29 -0800347 // structure maps original instructions into the new instructions.
348 // Contents reside in phase-local heap memory.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100349 ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_map_;
Aart Bikf8f5a162017-02-06 15:35:29 -0800350
Aart Bik0148de42017-09-05 09:25:01 -0700351 // Permanent mapping used during vectorization synthesis.
352 // Contents reside in phase-local heap memory.
Vladimir Markoca6fff82017-10-03 14:49:14 +0100353 ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_permanent_map_;
Aart Bik0148de42017-09-05 09:25:01 -0700354
Aart Bikf8f5a162017-02-06 15:35:29 -0800355 // Temporary vectorization bookkeeping.
Aart Bik14a68b42017-06-08 14:06:58 -0700356 VectorMode vector_mode_; // synthesis mode
Aart Bikf8f5a162017-02-06 15:35:29 -0800357 HBasicBlock* vector_preheader_; // preheader of the new loop
358 HBasicBlock* vector_header_; // header of the new loop
359 HBasicBlock* vector_body_; // body of the new loop
Aart Bik14a68b42017-06-08 14:06:58 -0700360 HInstruction* vector_index_; // normalized index of the new loop
Aart Bikf8f5a162017-02-06 15:35:29 -0800361
Artem Serov121f2032017-10-23 19:19:06 +0100362 // Helper for target-specific behaviour for loop optimizations.
Artem Serovcf43fb62018-02-15 14:43:48 +0000363 ArchNoOptsLoopHelper* arch_loop_helper_;
Artem Serov121f2032017-10-23 19:19:06 +0100364
Aart Bik281c6812016-08-26 11:31:48 -0700365 friend class LoopOptimizationTest;
366
367 DISALLOW_COPY_AND_ASSIGN(HLoopOptimization);
368};
369
370} // namespace art
371
372#endif // ART_COMPILER_OPTIMIZING_LOOP_OPTIMIZATION_H_