OSDN Git Service

* gcc.target/i386/opt-1.c: Add --param min-insn-to-prefetch -ratio=0
[pf3gnuchains/gcc-fork.git] / gcc / predict.c
index f210428..e18f937 100644 (file)
@@ -196,7 +196,9 @@ maybe_hot_edge_p (edge e)
   return maybe_hot_frequency_p (EDGE_FREQUENCY (e));
 }
 
+
 /* Return true in case BB is probably never executed.  */
+
 bool
 probably_never_executed_bb_p (const_basic_block bb)
 {
@@ -209,24 +211,31 @@ probably_never_executed_bb_p (const_basic_block bb)
   return false;
 }
 
-/* Return true when current function should always be optimized for size.  */
+/* Return true if NODE should be optimized for size.  */
 
 bool
-optimize_function_for_size_p (struct function *fun)
+cgraph_optimize_for_size_p (struct cgraph_node *node)
 {
-  struct cgraph_node *node;
-
   if (optimize_size)
     return true;
-  if (!fun || !fun->decl)
-    return false;
-  node = cgraph_get_node (fun->decl);
   if (node && (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED))
     return true;
   else
     return false;
 }
 
+/* Return true when current function should always be optimized for size.  */
+
+bool
+optimize_function_for_size_p (struct function *fun)
+{
+  if (optimize_size)
+    return true;
+  if (!fun || !fun->decl)
+    return false;
+  return cgraph_optimize_for_size_p (cgraph_get_node (fun->decl));
+}
+
 /* Return true when current function should always be optimized for speed.  */
 
 bool
@@ -2282,7 +2291,7 @@ tree
 build_predict_expr (enum br_predictor predictor, enum prediction taken)
 {
   tree t = build1 (PREDICT_EXPR, void_type_node,
-                  build_int_cst (NULL, predictor));
+                  build_int_cst (integer_type_node, predictor));
   SET_PREDICT_EXPR_OUTCOME (t, taken);
   return t;
 }