aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-02-07 23:00:04 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-02-09 23:56:01 +0100
commitffb24e18c9b83e5878ee9ca4513deb5de235e15c (patch)
treec657944ad6a0b204bac6592f3127315d6470419f /validation
parentb369f9225bfcf59361c986c8b7fbbacb420cb936 (diff)
downloadsparse-dev-ffb24e18c9b83e5878ee9ca4513deb5de235e15c.tar.gz
do the tree inlining during expansion phase
Currently, the tree inlining is done very early, during the evaluation phase. This means that the inlining is done even if the corresponding call belong to a sub-expression that will be discarded during the expansion phase. Usually this is not a problem but in some pathological cases it can lead to a huge waste of memory and CPU time. So, move this inline expansion to ... the expansion phase. Also, re-expand the resulting expression since constant arguments may create new opportunities for simplification. Note: the motivation for thsi is a pathological case in the kernel where a combination of max_t() + const_ilog2() + roundup_pow_of_two() + cpumask_weight() + __const_hweight*() caused Sparse to use 2.3Gb of memory. With this patch the memory consumption is down to 247Mb. Link: https://marc.info/?l=linux-sparse&m=158098958501220 Link: https://lore.kernel.org/netdev/CAHk-=whvS9x5NKtOqcUgJeTY7dfdAHc Reported-by: Randy Dunlap <rdunlap@infradead.org> Originally-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/expand/builtin_constant_inline0.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/expand/builtin_constant_inline0.c b/validation/expand/builtin_constant_inline0.c
index 9e775d5e..a0057f20 100644
--- a/validation/expand/builtin_constant_inline0.c
+++ b/validation/expand/builtin_constant_inline0.c
@@ -11,7 +11,6 @@ int foo(void)
/*
* check-name: builtin_constant_inline0
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-start
foo: