From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7379 invoked by alias); 20 Oct 2014 10:18:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7324 invoked by uid 48); 20 Oct 2014 10:18:18 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63594] [5 Regression] ICE: in ix86_vector_duplicate_value, at config/i386/i386.c:39831 with -mavx512f Date: Mon, 20 Oct 2014 10:39:00 -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: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01521.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63594 --- Comment #3 from Jakub Jelinek --- Created attachment 33761 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33761&action=edit WIP patch for discussions >>From what I see, if TARGET_AVX512BW is not defined, then we obviously can't use ix86_vector_duplicate_value, but need two instructions (either it can be QI->V32QI / HI->V16HI broadcast followed by concat of the two parts, or QI->V16QI / HI->V8HI broadcast followed by concat of the 4 parts together). But, it seems even for -mavx2 or -mavx we actually generate terrible code, for -mavx2 there is no point in using 2 instructions when in theory vpbroadcast{b,w} should handle it alone just fine. The patch enables all of that, but unfortunately we generate perhaps not so good code with it, e.g. for -mavx2 in testchar32, we spill the argument always to memory, and then broadcast it from memory, even when vmovd + broadcast from register could have been used. And in testchar16, for some reason we spill into memory, and broadcast from vmovd result (so the spill is totally useless). Uros/Kyrill, any thoughts on this?