Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-07 Thread Richard Guenther
On Fri, May 6, 2011 at 7:57 PM, Xinliang David Li davi...@google.com wrote: I want propose a more general solution. 1) Generic Annotation Support for gcc IR -- it is used attach to application/optimization specific annotation to gimple statements and annotations can be passed around across

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-07 Thread Xinliang David Li
On Sat, May 7, 2011 at 5:46 AM, Richard Guenther richard.guent...@gmail.com wrote: On Fri, May 6, 2011 at 7:57 PM, Xinliang David Li davi...@google.com wrote: I want propose a more general solution. 1) Generic Annotation Support for gcc IR -- it is used attach to application/optimization

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-06 Thread Richard Guenther
On Thu, May 5, 2011 at 7:02 PM, Xinliang David Li davi...@google.com wrote: On Thu, May 5, 2011 at 2:16 AM, Richard Guenther richard.guent...@gmail.com wrote: On Thu, May 5, 2011 at 12:19 AM, Xinliang David Li davi...@google.com wrote: I can think of some more-or-less obvious high-level

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-06 Thread Diego Novillo
On Fri, May 6, 2011 at 04:55, Richard Guenther richard.guent...@gmail.com wrote: On Thu, May 5, 2011 at 7:02 PM, Xinliang David Li davi...@google.com wrote: 2) Support of CallInfo for each callsite. This is an annotation, but more standardized. The callinfo can be used to record information

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-06 Thread Xinliang David Li
I want propose a more general solution. 1) Generic Annotation Support for gcc IR -- it is used attach to application/optimization specific annotation to gimple statements and annotations can be passed around across passes. In gcc, I only see HISTOGRAM annotation for value profiling, which is

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-05 Thread Richard Guenther
On Thu, May 5, 2011 at 12:19 AM, Xinliang David Li davi...@google.com wrote: I can think of some more-or-less obvious high-level forms, one would for example simply stick a new DISPATCH tree into gimple_call_fn (similar to how we can have OBJ_TYPE_REF there), the DISPATCH tree would be of

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-04 Thread Richard Guenther
On Tue, May 3, 2011 at 11:57 PM, Xinliang David Li davi...@google.com wrote: On Tue, May 3, 2011 at 3:00 AM, Richard Guenther richard.guent...@gmail.com wrote: On Tue, May 3, 2011 at 1:07 AM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:33 PM, Richard Guenther

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-04 Thread Diego Novillo
On Wed, May 4, 2011 at 15:35, Sriraman Tallam tmsri...@google.com wrote:        * tree-pass.h (pass_tree_convert_builtin_dispatch): New pass.        (pass_ipa_multiversion_dispatch): New pass.        * builtin-types.def (BT_PTR_FN_INT): New pointer type.        

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-04 Thread Sriraman Tallam
I submitted the patch. Thanks, -Sri. On Wed, May 4, 2011 at 3:13 PM, Diego Novillo dnovi...@google.com wrote: On Wed, May 4, 2011 at 15:35, Sriraman Tallam tmsri...@google.com wrote:        * tree-pass.h (pass_tree_convert_builtin_dispatch): New pass.        (pass_ipa_multiversion_dispatch):

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-04 Thread Xinliang David Li
I can think of some more-or-less obvious high-level forms, one would for example simply stick a new DISPATCH tree into gimple_call_fn (similar to how we can have OBJ_TYPE_REF there), the DISPATCH tree would be of variable length, first operand the selector function and further operands

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-03 Thread Richard Guenther
On Tue, May 3, 2011 at 1:07 AM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:33 PM, Richard Guenther richard.guent...@gmail.com wrote: On Mon, May 2, 2011 at 6:41 PM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:11 AM, Richard Guenther

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-03 Thread Richard Guenther
On Tue, May 3, 2011 at 12:00 PM, Richard Guenther richard.guent...@gmail.com wrote: 3) it limits the lowering into one form which may not be ideal  -- with builtin_dispatch, after hoisting optimization, the lowering can use more efficient IFUNC scheme, for instance. I see no reason why we

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-03 Thread Joseph S. Myers
On Tue, 3 May 2011, Mike Stump wrote: And to go one step further, if we had this, we could use this to define all data manipulation machine built-ins as generic functions, available to all compiles as normal c code, so portable code could use them everywhere, and on platforms that had

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-03 Thread Xinliang David Li
On Tue, May 3, 2011 at 3:00 AM, Richard Guenther richard.guent...@gmail.com wrote: On Tue, May 3, 2011 at 1:07 AM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:33 PM, Richard Guenther richard.guent...@gmail.com wrote: On Mon, May 2, 2011 at 6:41 PM, Xinliang David Li

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Richard Guenther
On Fri, Apr 29, 2011 at 6:23 PM, Xinliang David Li davi...@google.com wrote: Here is the background for this feature: 1) People relies on function multi-version to explore hw features and squeeze performance, but there is no standard ways of doing so, either a) using indirect function calls

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Xinliang David Li
On Mon, May 2, 2011 at 2:11 AM, Richard Guenther richard.guent...@gmail.com wrote: On Fri, Apr 29, 2011 at 6:23 PM, Xinliang David Li davi...@google.com wrote: Here is the background for this feature: 1) People relies on function multi-version to explore hw features and squeeze performance,

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Sriraman Tallam
Hi, I want to submit this patch to google/main to make sure it is available for our internal use at Google in order to materialize some optimization opportunities. Let us continue this dicussion as I make changes and submit this for review for trunk. Thanks, -Sri. On Mon, May 2, 2011 at 9:41

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Xinliang David Li
Ok. There may be more correctness related comments -- but those can be addressed when available. For trunk, you need to address issues such as multi-way dispatch. Thanks, David On Mon, May 2, 2011 at 12:11 PM, Sriraman Tallam tmsri...@google.com wrote: Hi,  I want to submit this patch to

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Richard Guenther
On Mon, May 2, 2011 at 6:41 PM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:11 AM, Richard Guenther richard.guent...@gmail.com wrote: On Fri, Apr 29, 2011 at 6:23 PM, Xinliang David Li davi...@google.com wrote: Here is the background for this feature: 1) People

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-05-02 Thread Xinliang David Li
On Mon, May 2, 2011 at 2:33 PM, Richard Guenther richard.guent...@gmail.com wrote: On Mon, May 2, 2011 at 6:41 PM, Xinliang David Li davi...@google.com wrote: On Mon, May 2, 2011 at 2:11 AM, Richard Guenther richard.guent...@gmail.com wrote: On Fri, Apr 29, 2011 at 6:23 PM, Xinliang David Li

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-04-29 Thread Richard Guenther
On Fri, Apr 29, 2011 at 4:52 AM, Sriraman Tallam tmsri...@google.com wrote: I want this patch to be considered for google/main now. This is intended to be submitted to trunk for review soon. This patch has been tested with crosstool bootstrap using buildit and by running all tests. Patch

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-04-29 Thread Xinliang David Li
Here is the background for this feature: 1) People relies on function multi-version to explore hw features and squeeze performance, but there is no standard ways of doing so, either a) using indirect function calls with function pointers set at program initialization; b) using manual dispatch at

Re: [google] Patch to support calling multi-versioned functions via new GCC builtin. (issue4440078)

2011-04-29 Thread Sriraman Tallam
Hi Richard, Thanks for the comments. Please find inline responses. On Fri, Apr 29, 2011 at 1:56 AM, Richard Guenther richard.guent...@gmail.com wrote: On Fri, Apr 29, 2011 at 4:52 AM, Sriraman Tallam tmsri...@google.com wrote: I want this patch to be considered for google/main now. This is