Mercurial > hg > truffle
comparison src/share/vm/opto/compile.hpp @ 1172:b2b6a9bf6238
6894779: Loop Predication for Loop Optimizer in C2
Summary: Loop predication implementation
Reviewed-by: never, kvn
author | cfang |
---|---|
date | Tue, 12 Jan 2010 14:37:35 -0800 |
parents | 7c57aead6d3e |
children | b4b440360f1e |
comparison
equal
deleted
inserted
replaced
1160:f24201449cac | 1172:b2b6a9bf6238 |
---|---|
36 class Node_Array; | 36 class Node_Array; |
37 class Node_Notes; | 37 class Node_Notes; |
38 class OptoReg; | 38 class OptoReg; |
39 class PhaseCFG; | 39 class PhaseCFG; |
40 class PhaseGVN; | 40 class PhaseGVN; |
41 class PhaseIterGVN; | |
41 class PhaseRegAlloc; | 42 class PhaseRegAlloc; |
42 class PhaseCCP; | 43 class PhaseCCP; |
43 class PhaseCCP_DCE; | 44 class PhaseCCP_DCE; |
44 class RootNode; | 45 class RootNode; |
45 class relocInfo; | 46 class relocInfo; |
170 ciEnv* _env; // CI interface | 171 ciEnv* _env; // CI interface |
171 CompileLog* _log; // from CompilerThread | 172 CompileLog* _log; // from CompilerThread |
172 const char* _failure_reason; // for record_failure/failing pattern | 173 const char* _failure_reason; // for record_failure/failing pattern |
173 GrowableArray<CallGenerator*>* _intrinsics; // List of intrinsics. | 174 GrowableArray<CallGenerator*>* _intrinsics; // List of intrinsics. |
174 GrowableArray<Node*>* _macro_nodes; // List of nodes which need to be expanded before matching. | 175 GrowableArray<Node*>* _macro_nodes; // List of nodes which need to be expanded before matching. |
176 GrowableArray<Node*>* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. | |
175 ConnectionGraph* _congraph; | 177 ConnectionGraph* _congraph; |
176 #ifndef PRODUCT | 178 #ifndef PRODUCT |
177 IdealGraphPrinter* _printer; | 179 IdealGraphPrinter* _printer; |
178 #endif | 180 #endif |
179 | 181 |
349 if (_printer) _printer->end_method(); | 351 if (_printer) _printer->end_method(); |
350 #endif | 352 #endif |
351 } | 353 } |
352 | 354 |
353 int macro_count() { return _macro_nodes->length(); } | 355 int macro_count() { return _macro_nodes->length(); } |
356 int predicate_count() { return _predicate_opaqs->length();} | |
354 Node* macro_node(int idx) { return _macro_nodes->at(idx); } | 357 Node* macro_node(int idx) { return _macro_nodes->at(idx); } |
358 Node* predicate_opaque1_node(int idx) { return _predicate_opaqs->at(idx);} | |
355 ConnectionGraph* congraph() { return _congraph;} | 359 ConnectionGraph* congraph() { return _congraph;} |
356 void add_macro_node(Node * n) { | 360 void add_macro_node(Node * n) { |
357 //assert(n->is_macro(), "must be a macro node"); | 361 //assert(n->is_macro(), "must be a macro node"); |
358 assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); | 362 assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); |
359 _macro_nodes->append(n); | 363 _macro_nodes->append(n); |
361 void remove_macro_node(Node * n) { | 365 void remove_macro_node(Node * n) { |
362 // this function may be called twice for a node so check | 366 // this function may be called twice for a node so check |
363 // that the node is in the array before attempting to remove it | 367 // that the node is in the array before attempting to remove it |
364 if (_macro_nodes->contains(n)) | 368 if (_macro_nodes->contains(n)) |
365 _macro_nodes->remove(n); | 369 _macro_nodes->remove(n); |
366 } | 370 // remove from _predicate_opaqs list also if it is there |
371 if (predicate_count() > 0 && _predicate_opaqs->contains(n)){ | |
372 _predicate_opaqs->remove(n); | |
373 } | |
374 } | |
375 void add_predicate_opaq(Node * n) { | |
376 assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); | |
377 assert(_macro_nodes->contains(n), "should have already been in macro list"); | |
378 _predicate_opaqs->append(n); | |
379 } | |
380 // remove the opaque nodes that protect the predicates so that the unused checks and | |
381 // uncommon traps will be eliminated from the graph. | |
382 void cleanup_loop_predicates(PhaseIterGVN &igvn); | |
367 | 383 |
368 // Compilation environment. | 384 // Compilation environment. |
369 Arena* comp_arena() { return &_comp_arena; } | 385 Arena* comp_arena() { return &_comp_arena; } |
370 ciEnv* env() const { return _env; } | 386 ciEnv* env() const { return _env; } |
371 CompileLog* log() const { return _log; } | 387 CompileLog* log() const { return _log; } |