+/* Find calls inside STMT for that we want to measure histograms for
+ indirect/virtual call optimization. */
+
+static void
+gimple_indirect_call_to_profile (gimple stmt, histogram_values *values)
+{
+ tree callee;
+
+ if (gimple_code (stmt) != GIMPLE_CALL
+ || gimple_call_fndecl (stmt) != NULL_TREE)
+ return;
+
+ callee = gimple_call_fn (stmt);
+
+ VEC_reserve (histogram_value, heap, *values, 3);
+
+ VEC_quick_push (histogram_value, *values,
+ gimple_alloc_histogram_value (cfun, HIST_TYPE_INDIR_CALL,
+ stmt, callee));
+
+ return;
+}
+
+/* Find values inside STMT for that we want to measure histograms for
+ string operations. */
+static void
+gimple_stringops_values_to_profile (gimple stmt, histogram_values *values)
+{
+ tree fndecl;
+ tree blck_size;
+ tree dest;
+ enum built_in_function fcode;
+
+ if (gimple_code (stmt) != GIMPLE_CALL)
+ return;
+ fndecl = gimple_call_fndecl (stmt);
+ if (!fndecl)
+ return;
+ fcode = DECL_FUNCTION_CODE (fndecl);
+
+ if (!interesting_stringop_to_profile_p (fndecl, stmt))
+ return;
+
+ dest = gimple_call_arg (stmt, 0);
+ if (fcode == BUILT_IN_BZERO)
+ blck_size = gimple_call_arg (stmt, 1);
+ else
+ blck_size = gimple_call_arg (stmt, 2);
+
+ if (TREE_CODE (blck_size) != INTEGER_CST)
+ {
+ VEC_safe_push (histogram_value, heap, *values,
+ gimple_alloc_histogram_value (cfun, HIST_TYPE_SINGLE_VALUE,
+ stmt, blck_size));
+ VEC_safe_push (histogram_value, heap, *values,
+ gimple_alloc_histogram_value (cfun, HIST_TYPE_AVERAGE,
+ stmt, blck_size));
+ }
+ if (TREE_CODE (blck_size) != INTEGER_CST)
+ VEC_safe_push (histogram_value, heap, *values,
+ gimple_alloc_histogram_value (cfun, HIST_TYPE_IOR,
+ stmt, dest));
+}
+
+/* Find values inside STMT for that we want to measure histograms and adds
+ them to list VALUES. */
+