This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/82356] auto-vectorizing pack of 16->8 has a redundant AND after a shift


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82356

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-09-29
          Component|tree-optimization           |rtl-optimization
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The vectorizer itself just emits

  <bb 13> [81.00%]:
  # ivtmp.30_143 = PHI <0(12), ivtmp.30_144(13)>
  # ivtmp.35_145 = PHI <0(12), ivtmp.35_146(13)>
  vect__1.15_75 = MEM[base: vectp_src.14_71, index: ivtmp.35_145, step: 2,
offset: 0B];
  vect__1.16_77 = MEM[base: vectp_src.14_71, index: ivtmp.35_145, step: 2,
offset: 16B];
  vect__2.17_78 = vect__1.15_75 >> 8;
  vect__2.17_79 = vect__1.16_77 >> 8;
  vect__3.18_80 = VEC_PACK_TRUNC_EXPR <vect__2.17_78, vect__2.17_79>;
  MEM[base: vectp_dst.20_81, index: ivtmp.35_145, offset: 0B] = vect__3.18_80;
  ivtmp.30_144 = ivtmp.30_143 + 1;
  ivtmp.35_146 = ivtmp.35_145 + 16;
  if (bnd.9_65 > ivtmp.30_144)
    goto <bb 13>; [83.34%]

it seems the ands come from VEC_PAC_TRUNC_EXPR expansion somehow.

(insn 150 149 151 (set (reg:V8HI 219)
        (and:V8HI (reg:V8HI 221)
            (reg:V8HI 214 [ vect__2.17 ]))) "t.c":5 -1
     (nil))

(insn 151 150 152 (set (reg:V8HI 220)
        (and:V8HI (reg:V8HI 221)
            (reg:V8HI 216 [ vect__2.17 ]))) "t.c":5 -1
     (nil))

(insn 152 151 153 (set (reg:V16QI 218 [ vect__3.18 ])
        (vec_concat:V16QI (us_truncate:V8QI (reg:V8HI 219))
            (us_truncate:V8QI (reg:V8HI 220)))) "t.c":5 -1
     (nil))

and combine / simplify-rtx are not able to remove them again (no wonders,
simplify-rtx is notoriously unaware of vectors).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]