diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-08 01:11:00 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 09:25:34 +0200 |
| commit | 6faa3df7a00349041436b6b17a3891425f0b8928 (patch) | |
| tree | 2817dcb90eeccc925e8b638d0da44c6602f083db | |
| parent | bea53a10f6db02d7253fa9f05390bc4caad14628 (diff) | |
| download | sparse-dev-6faa3df7a00349041436b6b17a3891425f0b8928.tar.gz | |
switch return order in simplify_mask_or_and()
This function used an early return when the test guarding
the simplification failed but this make impossible to add
other ones simplifications.
In preparation for incoming additional simplifications,
negate the test and switch the returns so that the early return
is now a catch-all return when no simplifications can apply.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | simplify.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -599,12 +599,11 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas return 0; omask = src2->value; nmask = omask & mask; - if (nmask != 0) - return 0; - // replace OP(((x & M') | b), K) - // by OP(b, K) - // when (M' & M) == 0 - return replace_pseudo(insn, &insn->src1, orb); + if (nmask == 0) { + // if (M' & M) == 0: ((a & M') | b) -> b + return replace_pseudo(insn, &insn->src1, orb); + } + return 0; } /// |
