From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 635953857427; Mon, 13 Sep 2021 15:31:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 635953857427 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/loop-unswitching-switch-v3)] Update tests. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/loop-unswitching-switch-v3 X-Git-Oldrev: 5875de6f0c4d44291e37695ae5e18602af93daa5 X-Git-Newrev: 582dd1d5e42348b71924ecc5446934df23f98b07 Message-Id: <20210913153102.635953857427@sourceware.org> Date: Mon, 13 Sep 2021 15:31:02 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 15:31:02 -0000 https://gcc.gnu.org/g:582dd1d5e42348b71924ecc5446934df23f98b07 commit 582dd1d5e42348b71924ecc5446934df23f98b07 Author: Martin Liska Date: Mon Sep 13 15:04:32 2021 +0200 Update tests. Diff: --- gcc/testsuite/gcc.dg/loop-unswitch-9.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-9.c b/gcc/testsuite/gcc.dg/loop-unswitch-9.c index 28b6e9669d5..3058d4a5b38 100644 --- a/gcc/testsuite/gcc.dg/loop-unswitch-9.c +++ b/gcc/testsuite/gcc.dg/loop-unswitch-9.c @@ -2,20 +2,25 @@ /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */ int -foo(double *a, double *b, double *c, double *d, double *r, int size, int order) +foo(double *a, double *b, double *c, double *d, double *r, int size, unsigned order) { for (int i = 0; i < size; i++) { double tmp; - if (order < 5) - tmp = -8 * a[i]; - else - tmp = -4 * b[i]; + switch (order) + { + case 0 ... 4: + tmp = -8 * a[i]; + break; + default: + tmp = -4 * b[i]; + break; + } double x = 3 * tmp + d[i] + tmp; - /* This should not be unswitched as it's mutually excluded with order < 5. */ + /* This should not be unswitched as it's mutually excluded with case 0 ... 4. */ if (order >= 5) x += 2; @@ -26,4 +31,4 @@ foo(double *a, double *b, double *c, double *d, double *r, int size, int order) return 0; } -/* { dg-final { scan-tree-dump-times ";; Unswitching loop with condition: order.* == 1" 1 "unswitch" } } */ +/* { dg-final { scan-tree-dump-times ";; Unswitching loop with condition: order.* <= 4" 1 "unswitch" } } */