diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 17:31:57 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-24 08:18:56 +0200 |
| commit | 1d78043467a769ccf2d81d55f898fb37f158b14f (patch) | |
| tree | e26ffeac2e858644f02a87f558f2ccff56e1ed78 /validation/optim | |
| parent | 3f2cbce78f78cbae35a02eb318a86f78556f71aa (diff) | |
| download | sparse-dev-1d78043467a769ccf2d81d55f898fb37f158b14f.tar.gz | |
simplify TRUNC(SHIFT(a | b, S), N)
The simplification of TRUNC(SHIFT(a | b, S), N) can be done by
combining the effective mask corresponding to TRUNC(_, N) with
the one corresponding to SHIFT(_, S).
This allows to also simplify signed bitfields. For example, code like:
struct s {
signed int :2;
signed int f:3;
};
int bfs(struct s s, int a)
{
s.f = a;
return s.f;
}
is now simplified into the minimal:
bfs:
trunc.3 %r4 <- (32) %arg2
sext.32 %r11 <- (3) %r4
ret.32 %r11
The simplification is done by calling simplify_mask_shift() with
the mask corresponding to TRUNC(_, N).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/and-or-bfs.c | 1 | ||||
| -rw-r--r-- | validation/optim/bitfield-store-loads.c | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/validation/optim/and-or-bfs.c b/validation/optim/and-or-bfs.c index e08b816e..f3f33204 100644 --- a/validation/optim/and-or-bfs.c +++ b/validation/optim/and-or-bfs.c @@ -12,7 +12,6 @@ int bfs(struct s s, int a) /* * check-name: and-or-bfs * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-pattern(1): trunc\\. diff --git a/validation/optim/bitfield-store-loads.c b/validation/optim/bitfield-store-loads.c index 99a0a03a..dc625131 100644 --- a/validation/optim/bitfield-store-loads.c +++ b/validation/optim/bitfield-store-loads.c @@ -12,7 +12,6 @@ int foo(struct s s, int a) /* * check-name: bitfield-store-load signed * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: shl\\. |
