diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-02-23 13:59:57 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-28 18:55:41 +0200 |
| commit | 22a058c697d310797c6af326345c68739778b7c4 (patch) | |
| tree | 86078ce96c7bb45c7f21f6b11c2ff2183cbf6c75 /validation/optim/bool-simplify.c | |
| parent | e124eabaa61618abd9af2b60ecb1646a9db7091b (diff) | |
| download | sparse-dev-22a058c697d310797c6af326345c68739778b7c4.tar.gz | |
bool: generate plain OP_{AND,OR} instead of OP_{AND,OR}_BOOL
Now that OP_AND_BOOL and OP_OR_BOOL are always given boolean
operands, they are just a special case of 1 bit OP_AND & OP_OR.
To avoid to have to repeat CSE, simplification patterns, ...
better to generate plain OP_AND & OP_OR instead.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim/bool-simplify.c')
| -rw-r--r-- | validation/optim/bool-simplify.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c index 5b3cf449..68aabb78 100644 --- a/validation/optim/bool-simplify.c +++ b/validation/optim/bool-simplify.c @@ -18,6 +18,17 @@ int or_1(int a) return a || 1; } +// try again but with something true but != 1 +int and_2(int a) +{ + return a && 2; +} + +int or_2(int a) +{ + return a || 2; +} + /* * check-name: bool-simplify * check-command: test-linearize -Wno-decl $file @@ -51,5 +62,19 @@ or_1: ret.32 $1 +and_2: +.L8: + <entry-point> + setne.1 %r26 <- %arg1, $0 + zext.32 %r29 <- (1) %r26 + ret.32 %r29 + + +or_2: +.L10: + <entry-point> + ret.32 $1 + + * check-output-end */ |
