search for: knownnonnull

Displaying 3 results from an estimated 3 matches for "knownnonnull".

2017 Aug 07
3
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...site if it can prove that one of the arguments to the call can be replaced by a constant, based on dominating conditions, e.g.: if (!ptr || ptr && ptr->val) foo(ptr, ...) => if (!ptr) foo(nullptr, ...) else if (ptr && ptr->val) foo(ptr /*knownNonNull*/, ...) Here the first argument becomes constant for the first callsite and a further analysis pass sets the KnownNonNull attribute on the first argument in the second callsite. The InlinerCost algorithm can then determine it is cheap enough to inline both cases, because it knows the callee (foo)...
2017 Aug 07
2
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...ating > conditions, e.g.: > > if (!ptr || ptr && ptr->val) > > foo(ptr, ...) > > => > > if (!ptr) > > foo(nullptr, ...) > > else if (ptr && ptr->val) > > foo(ptr /*knownNonNull*/, ...) > > Here the first argument becomes constant for the first callsite > and a further analysis pass sets the KnownNonNull attribute on the > first argument in the second callsite. The InlinerCost algorithm > can then determine it is cheap enough to inline both c...
2017 Aug 04
4
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
On 8/4/2017 2:06 PM, Daniel Berlin wrote: > A few notes: > I'm a bit surprised IPO copy/constant propagation doesn't get this > case, but i didn't look if the lattice supports variables. > In particular, in your example, given no other call sites, it should > eliminate the dead code. > (In a real program, it may require cloning). In the actual program