netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Yonghong Song <yhs@fb.com>
Cc: "alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"oss-drivers@netronome.com" <oss-drivers@netronome.com>
Subject: Re: [RFC bpf-next v3 03/12] bpf: verifier: remove dead code
Date: Mon, 31 Dec 2018 14:27:50 -0800	[thread overview]
Message-ID: <20181231142750.0f93d3fa@cakuba.hsd1.ca.comcast.net> (raw)
In-Reply-To: <790ec09d-cdbc-96cc-e7f7-2b0d7bb6dd35@fb.com>

On Mon, 31 Dec 2018 21:41:22 +0000, Yonghong Song wrote:
> > func2 after func adjust will start at off and there is no line info for
> > off + cnt (insn4), so we will preserve line_info2.  
> 
> Thanks for verification, I missed that
>  >>> +	/* count lines to be removed */
>  >>> +	l_off = i;
>  >>> +	l_cnt = 0;
>  >>> +	for (; i < nr_linfo; i++)
>  >>> +		if (linfo[i].insn_off < off + cnt)
>  >>> +			l_cnt++;
>  >>> +		else
>  >>> +			break;  
> once you reached linfo[i].insn_off >= off + cnt, no more counting.
> since l_cnt starts from 0, so the last one is actually preserved.

Ah, I see!

> > linfo1:
> > 	insn1
> > 	insn2 /* dead */
> > linfo2:
> > 	insn3 /* dead */
> > 	insn4
> > linfo3:
> > 	insn5
> > 
> >    ||
> >    \/
> > 
> > linfo1:
> > 	insn1
> > linfo2:
> > 	insn4
> > linfo3:
> > 	insn5  
> 
> Yes, the above is the desirable output.

Perfect, let me respin.

  reply	other threads:[~2018-12-31 22:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29  3:09 [RFC bpf-next v3 00/12] bpf: dead code elimination Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 01/12] bpf: change parameters of call/branch offset adjustment Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 02/12] bpf: verifier: hard wire branches to dead code Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 03/12] bpf: verifier: remove " Jakub Kicinski
2018-12-30 22:02   ` Yonghong Song
2018-12-31 20:31     ` Jakub Kicinski
2018-12-31 21:41       ` Yonghong Song
2018-12-31 22:27         ` Jakub Kicinski [this message]
2018-12-29  3:09 ` [RFC bpf-next v3 04/12] bpf: verifier: remove unconditional branches by 0 Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 05/12] selftests: bpf: add tests for dead code removal Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 06/12] bpf: verifier: record original instruction index Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 07/12] bpf: notify offload JITs about optimizations Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 08/12] nfp: bpf: don't use instruction number for jump target Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 09/12] nfp: bpf: split up the skip flag Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 10/12] nfp: bpf: save original program length Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 11/12] nfp: bpf: support optimizing dead branches Jakub Kicinski
2018-12-29  3:09 ` [RFC bpf-next v3 12/12] nfp: bpf: support removing dead code Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181231142750.0f93d3fa@cakuba.hsd1.ca.comcast.net \
    --to=jakub.kicinski@netronome.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).