This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/9] New template fibonacci_heap class introduced.


On 11/13/14 13:06, mliska wrote:
gcc/ChangeLog:

2014-11-13  Martin Liska  <mliska@suse.cz>

	* fibonacci_heap.h: New file.
	* ipa-inline.c (update_edge_key): New heap API is used.
	(update_caller_keys): Likewise.
	(update_callee_keys): Likewise.
	(lookup_recursive_calls): Likewise.
	(recursive_inlining): Likewise.
	(add_new_edges_to_heap): Likewise.
	(heap_edge_removal_hook): Likewise.
	(inline_small_functions): Likewise.
This is a very simple, literal translation of the old fibheap code into C++. Probably the hardest part of reviewing was translating between the function names between the two implementations.


+  /* Constructor for a node with givek KEY.  */
s/givek/given/

+	  if (x->compare (y) > 0)
+	    {
+	      /* TODO: swap */
+	      fibonacci_node_t *temp;
+	      temp = x;
+	      x = y;
+	      y = temp;
+	    }
Given the literal translation, I can see why you left this. Feel free to turn it into a swap, consider the patch pre-approved.

diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 5c97815..1ce856f 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -138,6 +138,10 @@ along with GCC; see the file COPYING3.  If not see
  #include "auto-profile.h"
  #include "cilk.h"
  #include "builtins.h"
+#include "fibonacci_heap.h"
If there are no more uses of fibheap.h, then remove its #include.

Approved with the nit fixes.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]