aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-18 18:43:38 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-22 09:26:18 +0200
commit729be196bb860270de32ec076873c6d327f592a0 (patch)
tree9dca57c34c6a1a934a986726d347e16a0b46e55d /validation
parentc68bfab0e487452d17534393efaa0c8da165aff0 (diff)
downloadsparse-dev-729be196bb860270de32ec076873c6d327f592a0.tar.gz
simplify ((x & M) >> S) when (M >> S) == (-1 >> S)
The instructions LSR(AND(x, M), S) are already simplified into AND(LSR(x, S), (M >> S)) but only if AND(x, M) has a single user. However, if (M >> S) == (-1 >> S), the AND part is redundant and the whole can always directly be simplified into LSR(x, S). For example, code like: unsigned foo(unsigned x) { unsigned t = (x & 0xfffff000); return ((t >> 12) ^ (x >> 12)) & t; } is now optimized into: foo: ret.32 $0 because (t >> 12) is simplified into (x >> 12). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/optim/lsr-and1.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/optim/lsr-and1.c b/validation/optim/lsr-and1.c
index e2eb5059..393679e3 100644
--- a/validation/optim/lsr-and1.c
+++ b/validation/optim/lsr-and1.c
@@ -12,7 +12,6 @@ unsigned lsr_and1(unsigned x)
/*
* check-name: lsr-and1
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-contains: ret\\..*\\$0$