From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH 2/5] simplify '(x / 1)' to 'x'
Date: Tue, 7 Feb 2017 15:52:27 +0100 [thread overview]
Message-ID: <20170207145226.vnxmuyk3rwbpqcse@macbook.local> (raw)
In-Reply-To: <CANeU7QmSHZf9p+0riTgtMFtSuopkHgmcwG_t1izjwg5sDa1B6g@mail.gmail.com>
On Tue, Feb 07, 2017 at 10:53:16AM +0800, Christopher Li wrote:
> On Wed, Dec 7, 2016 at 11:46 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> > Currently we simplify multiplication by 1 but nothing
> > for the similar divide by 1.
> >
> > --- a/simplify.c
> > +++ b/simplify.c
> > @@ -320,6 +320,10 @@ static int simplify_mul_div(struct instruction *insn, long long value)
> > case OP_MULU:
> > if (value == 0)
> > return replace_with_pseudo(insn, insn->src2);
> > + /* Fall through */
> > + case OP_DIVS:
> > + case OP_DIVU:
> > + break;
>
> This patch has already applied to sparse-next. Just one minor comment that
> if the fall through is just a break. It is better just break there. If
> the later code
> need to use the fall though, just add the fall through part with the later code.
Mmmh yes. In fact here these 4 lines are not needed at all.
It's most probably leftover of some code restructuration.
Do you want that I send a new version of this patch?
Luc
next prev parent reply other threads:[~2017-02-07 14:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 15:46 [PATCH 0/5] more simplification of constant multiplicative ops Luc Van Oostenryck
2016-12-07 15:46 ` [PATCH 1/5] move OP_MUL simplification in a separate function Luc Van Oostenryck
2016-12-07 15:46 ` [PATCH 2/5] simplify '(x / 1)' to 'x' Luc Van Oostenryck
2017-02-07 2:53 ` Christopher Li
2017-02-07 14:52 ` Luc Van Oostenryck [this message]
2017-02-07 18:29 ` Christopher Li
2017-02-07 19:00 ` [PATCH v2 0/5] more simplification of constant multiplicative ops Luc Van Oostenryck
2017-02-07 19:00 ` [PATCH v2 1/5] move OP_MUL simplification in a separate function Luc Van Oostenryck
2017-02-07 19:00 ` [PATCH v2 2/5] simplify '(x / 1)' to 'x' Luc Van Oostenryck
2017-02-07 19:00 ` [PATCH v2 3/5] simplify '(x * -1)' to '-x' Luc Van Oostenryck
2017-02-07 19:00 ` [PATCH v2 4/5] simplify '(x / -1)' to '-x' (but only for signed division) Luc Van Oostenryck
2017-02-07 19:39 ` Rasmus Villemoes
2017-02-07 20:28 ` Luc Van Oostenryck
2017-02-07 20:33 ` Christopher Li
2017-02-07 20:50 ` [PATCH v3 0/5] more simplification of constant multiplicative ops Luc Van Oostenryck
2017-02-07 20:50 ` [PATCH v3 1/5] move OP_MUL simplification in a separate function Luc Van Oostenryck
2017-02-07 20:50 ` [PATCH v3 2/5] simplify '(x / 1)' to 'x' Luc Van Oostenryck
2017-02-07 20:50 ` [PATCH v3 3/5] simplify '(x * -1)' to '-x' Luc Van Oostenryck
2017-02-07 20:50 ` [PATCH v3 4/5] simplify '(x / -1)' to '-x' (but only for signed division) Luc Van Oostenryck
2017-02-07 20:50 ` [PATCH v3 5/5] simplify '(x % 1)' into '0' Luc Van Oostenryck
2017-02-07 19:00 ` [PATCH v2 " Luc Van Oostenryck
2017-02-07 19:18 ` [PATCH v2 0/5] more simplification of constant multiplicative ops Christopher Li
2016-12-07 15:46 ` [PATCH 3/5] simplify '(x * -1)' to '-x' Luc Van Oostenryck
2016-12-07 15:46 ` [PATCH 4/5] simplify '(x / -1)' to '-x' (but only for signed division) Luc Van Oostenryck
2016-12-07 15:46 ` [PATCH 5/5] simplify '(x % 1)' into '0' Luc Van Oostenryck
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=20170207145226.vnxmuyk3rwbpqcse@macbook.local \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/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).