Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler/move-optimizer.h

Issue 1634093002: [turbofan] fine grained in-block move optimization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/move-optimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_MOVE_OPTIMIZER_ 5 #ifndef V8_COMPILER_MOVE_OPTIMIZER_
6 #define V8_COMPILER_MOVE_OPTIMIZER_ 6 #define V8_COMPILER_MOVE_OPTIMIZER_
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 class MoveOptimizer final { 15 class MoveOptimizer final {
16 public: 16 public:
17 MoveOptimizer(Zone* local_zone, InstructionSequence* code); 17 MoveOptimizer(Zone* local_zone, InstructionSequence* code);
18 void Run(); 18 void Run();
19 19
20 private: 20 private:
21 typedef ZoneVector<MoveOperands*> MoveOpVector; 21 typedef ZoneVector<MoveOperands*> MoveOpVector;
22 typedef ZoneVector<Instruction*> Instructions; 22 typedef ZoneVector<Instruction*> Instructions;
23 23
24 InstructionSequence* code() const { return code_; } 24 InstructionSequence* code() const { return code_; }
25 Zone* local_zone() const { return local_zone_; } 25 Zone* local_zone() const { return local_zone_; }
26 Zone* code_zone() const { return code()->zone(); } 26 Zone* code_zone() const { return code()->zone(); }
27 MoveOpVector& local_vector() { return local_vector_; } 27 MoveOpVector& local_vector() { return local_vector_; }
28 28
29 void CompressBlock(InstructionBlock* blocke); 29 // Consolidate moves into the first gap.
30 void CompressMoves(ParallelMove* left, ParallelMove* right); 30 void CompressGaps(Instruction* instr);
31
32 // Attempt to push down to the last instruction those moves that can.
33 void CompressBlock(InstructionBlock* block);
34
35 // Consolidate moves into the first gap.
36 void CompressMoves(ParallelMove* left, MoveOpVector* right);
37
38 // Push down those moves in the gap of from that do not change the
39 // semantics of the from instruction, nor the semantics of the moves
40 // that remain behind.
41 void MigrateMoves(Instruction* to, Instruction* from);
42
43 void RemoveClobberedDestinations(Instruction* instruction);
44
31 const Instruction* LastInstruction(const InstructionBlock* block) const; 45 const Instruction* LastInstruction(const InstructionBlock* block) const;
46
47 // Consolidate common moves appearing accross all predecessors of a block.
32 void OptimizeMerge(InstructionBlock* block); 48 void OptimizeMerge(InstructionBlock* block);
33 void FinalizeMoves(Instruction* instr); 49 void FinalizeMoves(Instruction* instr);
34 50
35 Zone* const local_zone_; 51 Zone* const local_zone_;
36 InstructionSequence* const code_; 52 InstructionSequence* const code_;
37 Instructions to_finalize_;
38 MoveOpVector local_vector_; 53 MoveOpVector local_vector_;
39 54
40 DISALLOW_COPY_AND_ASSIGN(MoveOptimizer); 55 DISALLOW_COPY_AND_ASSIGN(MoveOptimizer);
41 }; 56 };
42 57
43 } // namespace compiler 58 } // namespace compiler
44 } // namespace internal 59 } // namespace internal
45 } // namespace v8 60 } // namespace v8
46 61
47 #endif // V8_COMPILER_MOVE_OPTIMIZER_ 62 #endif // V8_COMPILER_MOVE_OPTIMIZER_
OLDNEW
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/move-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698