From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 444703851C0A; Wed, 3 Mar 2021 12:22:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 444703851C0A From: "joelh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99102] [11 Regression] SVE: Wrong code with -O2 -ftree-vectorize -march=armv8.2-a+sve -msve-vector-bits=256 Date: Wed, 03 Mar 2021 12:22:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: joelh at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: joelh at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 12:22:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99102 --- Comment #3 from Joel Hutton --- Seems like the 'vect' pass is vectorizing a 'MASK_STORE' to a 'SCATTER_STOR= E' and ignoring the mask. 1292 testcase.c:7:29: note: vect_is_simple_use: operand 0, type of def: constant$ 1293 testcase.c:7:29: note: created new init_stmt: vect_cst__65 =3D { 0, 0= , 0, 0 };$ 1294 testcase.c:7:29: note: add new stmt: mask__60.11_66 =3D vect_cst__64 = =3D=3D vect_cst__65;$ 1295 testcase.c:7:29: note: ------>vectorizing statement: _61 =3D &a[_10];$ 1296 testcase.c:7:29: note: ------>vectorizing statement: .MASK_STORE (_61, 128B, _60, _31);$ 1297 testcase.c:7:29: note: transform statement.$ 1298 testcase.c:7:29: note: vect_is_simple_use: operand l_23(D) =3D=3D 0, = type of def: internal$ 1299 testcase.c:7:29: note: vect_is_simple_use: vectype vector(4) $ 1300 testcase.c:7:29: note: vect_is_simple_use: operand (long intD.9) j_24= (D), type of def: internal$ 1301 testcase.c:7:29: note: vect_is_simple_use: vectype vector(4) long int$ 1302 Applying pattern match.pd:139, generic-match.c:24056$ 1303 Applying pattern match.pd:139, generic-match.c:24056$ 1304 testcase.c:7:29: note: transform store. ncopies =3D 1$ 1305 testcase.c:7:29: note: vect_get_vec_defs_for_operand: _31$ 1306 testcase.c:7:29: note: vect_is_simple_use: operand (long intD.9) j_24= (D), type of def: internal$ 1307 testcase.c:7:29: note: def_stmt =3D _31 =3D (long int) j_24(D);$ 1308 testcase.c:7:29: note: vect_get_vec_defs_for_operand: _60$ 1309 testcase.c:7:29: note: vect_is_simple_use: operand l_23(D) =3D=3D 0, = type of def: internal$ 1310 testcase.c:7:29: note: def_stmt =3D _60 =3D l_23(D) =3D=3D 0;$ 1311 testcase.c:7:29: note: create integer_type-pointer variable to type: = long int vectorizing a pointer ref: MEM[(long int *)&a]$ 1312 Applying pattern match.pd:139, generic-match.c:27580$ 1313 testcase.c:7:29: note: created &a$ 1314 testcase.c:7:29: note: add new stmt: .SCATTER_STORE (vectp_a.12_67, {= 0, 32, 64, 96 }, 1, vect__31.10_63);$ before: 112 [local count: 858993458]:$ 113 # i_39 =3D PHI $ 114 # ivtmp_16 =3D PHI $ 115 _1 =3D (int) i_39;$ 116 _2 =3D (long int) j_24(D);$ 117 _45 =3D l_23(D) =3D=3D 0;$ 118 _46 =3D &a[_1];$ 119 .MASK_STORE (_46, 128B, _45, _2);$ 120 i.0_3 =3D (unsigned short) i_39;$ 121 _4 =3D i.0_3 + 4;$ 122 i_26 =3D (short int) _4;$ 123 ivtmp_7 =3D ivtmp_16 - 1;$ 124 if (ivtmp_7 !=3D 0)$ 125 goto ; [75.00%]$ 126 else$ 127 goto ; [25.00%]$ 128 $ 129 [local count: 644245087]:$ 130 goto ; [100.00%]$ 131 $ 132 [local count: 214748368]:$ 133 h_22 =3D h_33 + 1;$ 134 if (_14 > h_22)$ 135 goto ; [89.00%]$ 136 else$ 137 goto ; [11.00%]$ after: 1525 # PT =3D null { D.3608 } (nonlocal)$ 1526 # ALIGN =3D 32, MISALIGN =3D 0$ 1527 # vectp_a.12_67 =3D PHI <&aD.3608(21), vectp_a.12_68(26)>$ 1528 # ivtmp_70 =3D PHI <0(21), ivtmp_71(26)>$ 1529 _10 =3D (intD.7) i_9;$ 1530 vect__31.10_63 =3D (vector(4) long intD.9) vect_cst__62;$ 1531 _31 =3D (long intD.9) j_24(D);$ 1532 mask__60.11_66 =3D vect_cst__64 =3D=3D vect_cst__65;$ 1533 _60 =3D l_23(D) =3D=3D 0;$ 1534 # PT =3D null { D.3608 } (nonlocal)$ 1535 _61 =3D &aD.3608[_10];$ 1536 # .MEM_69 =3D VDEF <.MEM_13>$ 1537 # USE =3D anything~$ 1538 # CLB =3D anything~$ 1539 .SCATTER_STORE (vectp_a.12_67, { 0, 32, 64, 96 }, 1, vect__31.10_63)= ;$ 1540 # RANGE [0, 14] NONZERO 12$ 1541 i.0_27 =3D (unsigned short) i_9;$ 1542 # RANGE [4, 18] NONZERO 28$ 1543 _28 =3D i.0_27 + 4;$ 1544 # RANGE [4, 18] NONZERO 28$ 1545 i_29 =3D (short intD.18) _28;$ 1546 ivtmp_30 =3D ivtmp_11 - 1;$ 1547 # PT =3D null { D.3608 } (nonlocal)$ 1548 # ALIGN =3D 32, MISALIGN =3D 0$ 1549 vectp_a.12_68 =3D vectp_a.12_67 + 128;$ 1550 ivtmp_71 =3D ivtmp_70 + 1;$ 1551 if (ivtmp_71 < 1)$ 1552 goto ; [0.00%]$ 1553 else$ 1554 goto ; [100.00%]$ 1555 ;; succ: 26 [never (adjusted)] count:0 (estimated locally) (TRUE_VALUE,EXECUTABLE)$ 1556 ;; 40 [always (adjusted)] count:214748371 (estimated locally) (FALSE_VALUE,EXECUTABLE)$ 1557 $ 1558 ;; basic block 26, loop depth 4, count 0 (estimated locally)$ 1559 ;; prev block 22, next block 40, flags: (NEW, VISITED)$ 1560 ;; pred: 22 [never (adjusted)] count:0 (estimated locally) (TRUE_VALUE,EXECUTABLE)$ 1561 goto ; [100.00%]$=