From: Daniel Borkmann <dan...@iogearbox.net> Date: Tue, 23 May 2017 23:27:20 +0200
> On 05/23/2017 09:45 PM, Alexei Starovoitov wrote: >> On 5/23/17 7:41 AM, Edward Cree wrote: >>> Hmm, that means that we can't do arithmetic on a >>> PTR_TO_MAP_VALUE_OR_NULL, we have to convert it to a PTR_TO_MAP_VALUE >>> first by NULL-checking it. That's probably fine, but I can just about >>> imagine some compiler optimisation reordering them. Any reason not to >>> split this out into a different reg->field, rather than overloading >>> id? >> >> 'id' is sort of like 'version' of a pointer and has the same meaning >> in >> both cases. How exactly do you see this split? > > Also, same id is never reused once generated and later propagated > through regs. So far we haven't run into this kind of optimization > from llvm side yet, but others which led to requiring the id marker > (see 57a09bf0a416). I could imagine it might be needed at some point, > though where we later transition directly to PTR_TO_MAP_VALUE_ADJ > after NULL check. Out of curiosity, did you run into it with llvm? We could handle this issue in find_good_pkt_pointers(), nothing prevents us from advancing state there for cases like Edward notes above.