OSDN Git Service

coccinelle: orplus: reorganize to improve performance
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 13 Nov 2017 05:53:35 +0000 (06:53 +0100)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 15 Nov 2017 23:56:42 +0000 (08:56 +0900)
commit937c812dfc0a25343d56b07734438610a1fb7b46
treead1f1cd178171d99fbd98e7bace9340b8f9bad13
parent6851ba1a1b22ba2e0800002d531bf04ced22ec18
coccinelle: orplus: reorganize to improve performance

Adding two #define constants is less common than performing & and |
operations on them, so put the addition first to reduce the set of cases
that have to be considered in detail.  At the same time, add & and |
patterns for both arguments of +, to account for commutativity and obtain
more results.

Running time is divided by 3 when applying this to the whole kernel on my
laptop with an Intel i5-6200U CPU.

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/coccinelle/misc/orplus.cocci