linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* idea/question about sparse's context checking
@ 2017-08-18 13:20 Luc Van Oostenryck
  2017-08-18 14:26 ` Josh Triplett
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Luc Van Oostenryck @ 2017-08-18 13:20 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-sparse

Hi Josh,

I was thinking lately about sparse's context checking.
I had an idea and I wondered if it hasn't already been
tried or discussed.

The context checking essentially works with the instruction
OP_CONTEXT, that do nothing more than adding or subtracting
some constant value to 'the context'. Then, at checking time,
these instructions are interpreted along all the paths and if
there is a disagreement between values from different paths,
it emits a 'context imbalance' warning (there is also the
checks for the expected return value of the context).

My idea/question is the following: this interpretation
is already done for all 'normal' values. So couldn't we
consider the context as a special kind of 'variable',
use a normal pseudo for it, use phi-nodes on them and
let the normal simplification process act on them?
If the context is (proveably) well balanced, there
shouldn't be any phi-node left for this context.

I'm not sure if there would be any significant advantage,
but it seems to me that what is currently done is
somehow redundant with the 'normal' processing.
It could also maybe help to have several independent
contexts.

[of course, we can't really use add/sub for the context
increase/decrease as we want to check if the context
don't become negative].


Best regards,
-- Luc

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-18 21:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 13:20 idea/question about sparse's context checking Luc Van Oostenryck
2017-08-18 14:26 ` Josh Triplett
2017-08-18 14:37 ` Christopher Li
2017-08-18 16:15   ` Luc Van Oostenryck
2017-08-18 18:18     ` Christopher Li
2017-08-18 19:01       ` Luc Van Oostenryck
2017-08-18 19:59         ` Christopher Li
2017-08-18 19:34 ` Linus Torvalds
2017-08-18 20:59   ` Luc Van Oostenryck
2017-08-18 21:10     ` Linus Torvalds
2017-08-18 21:56       ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).