diff options
| -rw-r--r-- | simplify.c | 5 | ||||
| -rw-r--r-- | validation/optim/and-or-bf2.c | 1 | ||||
| -rw-r--r-- | validation/optim/and-or-lsr2.c | 1 | ||||
| -rw-r--r-- | validation/optim/and-or-mask2.c | 1 |
4 files changed, 5 insertions, 3 deletions
@@ -613,6 +613,11 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas // if (M' & M) == M: ((a & M') | b) -> (a | b) return replace_pseudo(or, arg, and->src1); } + if (nmask != omask && !multi_users(ora)) { + // if (M' & M) != M': AND(a, M') -> AND(a, (M' & M)) + and->src2 = value_pseudo(nmask); + return REPEAT_CSE; + } return 0; } diff --git a/validation/optim/and-or-bf2.c b/validation/optim/and-or-bf2.c index cccaa85b..2296da12 100644 --- a/validation/optim/and-or-bf2.c +++ b/validation/optim/and-or-bf2.c @@ -14,7 +14,6 @@ void foo(struct s *p) /* * check-name: and-or-bf2 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-start foo: diff --git a/validation/optim/and-or-lsr2.c b/validation/optim/and-or-lsr2.c index a0df2963..d1af0135 100644 --- a/validation/optim/and-or-lsr2.c +++ b/validation/optim/and-or-lsr2.c @@ -6,7 +6,6 @@ int foo(int x, int y) /* * check-name: and-or-lsr2 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-contains: and\\..*\\$0xf0fff diff --git a/validation/optim/and-or-mask2.c b/validation/optim/and-or-mask2.c index 6c340c7e..cab802a6 100644 --- a/validation/optim/and-or-mask2.c +++ b/validation/optim/and-or-mask2.c @@ -6,7 +6,6 @@ int foo(int x, int y) /* * check-name: and-or-mask2 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-contains: and\\..*\\$0xf0f |
