search for: usecallback

Displaying 4 results from an estimated 4 matches for "usecallback".

Did you mean: s_callback
2010 Jun 04
3
[LLVMdev] Is there a "callback optimization"?
By that I mean an optimization pass (or a combination of them) that turns: void useCallback(void (*callbackfn)()) { // Do something callbackfn(); // Do something else } void myCallback() { // Respond one way } void myOtherCallback() { // Respond another way } void foo() { useCallback(myCallback); useCallback(myOtherCallback); } into: // Keep the original; it'll get removed // by...
2010 Jun 04
3
[LLVMdev] Is there a "callback optimization"?
When I used -std-compile-opts -disable-inlining, my transform didn't happen. I think in your test, the inline of UseCallback into foo automatically made the function pointer into a constant, which turned it into a direct call that was then inlined. If UseCallback is too big to inline and uses the callback parameter inside a loop, this transform is potentially valuable, particularly if UseCallback is called multiple time...
2010 Jun 04
0
[LLVMdev] Is there a "callback optimization"?
Hi Kenneth, > By that I mean an optimization pass (or a combination of them) that turns: ... > With that transform in place, lots of inlining becomes possible, and > direct function calls replace indirect function calls if inlining > isn't appropriate. If this transform is combined with argpromotion > and scalarrepl, it can be used for devirtualization of C++ virtual >
2010 Jun 04
0
[LLVMdev] Is there a "callback optimization"?
...sed for speed/space trade off estimation (specialize calls from hot code). Eugene On Fri, Jun 4, 2010 at 6:29 PM, Kenneth Uildriks <kennethuil at gmail.com> wrote: > When I used -std-compile-opts -disable-inlining, my transform didn't > happen.  I think in your test, the inline of UseCallback into foo > automatically made the function pointer into a constant, which turned > it into a direct call that was then inlined. > > If UseCallback is too big to inline and uses the callback parameter > inside a loop, this transform is potentially valuable, particularly if > UseCal...