From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id DEDA63858401 for ; Tue, 24 Aug 2021 17:03:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DEDA63858401 Received: by mail-pj1-x1032.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so2213166pjr.1 for ; Tue, 24 Aug 2021 10:03:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GJ0VxQ2W9rUNrOfcD0I8ptmPutBe6M+++5kkBFmcfs8=; b=F5ULgUJRJ2kgzvtpHixx+7CBsnh8jN8VZx5c/C47gnsTRsuJoyzSnWMiR53jp3uL8N s6kK1/dzBH7yA2g4wwcu2PfM5x/UxPK3lZV7kNMy7TgpMnYCGWSuWrFPDst7/8aks6xX rzw74dclGI027Xkf/IqUjvVW/I441W+yN0CVvO3dsODGe/iBpWZDDcixEGLxII7+x+6w 7+OPVUd9B77EOOQBVZ7kaGjCQXCQfTwJa8gugv3bdKyQ3LUwzMLfYJjR/fabtyW6ADvz zypH3DSnCQnWsh0S9ObOXNfxB296LypzixpjEullKwfqjShDM27wn1bepqRx1MHWtq6P jHIQ== X-Gm-Message-State: AOAM530nEg172GwR8Qs0Q/URCzgmYHumKk46Gk44oT+j4/5re2pggCNC nKBbPWxXoI/kF3EIHTEVjMbSMZleqcCoKWUd3QU= X-Google-Smtp-Source: ABdhPJzBD8CxmmYbFYVDy34pr3PYisn9SBXGxuCu+/MSAe+DKYYB3pQGbVWee4cQl3UT+IvgwAvCOad558xL6tjGnZ8= X-Received: by 2002:a17:902:b94b:b0:132:f696:29f1 with SMTP id h11-20020a170902b94b00b00132f69629f1mr13897273pls.4.1629824621495; Tue, 24 Aug 2021 10:03:41 -0700 (PDT) MIME-Version: 1.0 References: <20210822125346.154416-1-hjl.tools@gmail.com> <20210824161450.GI1583@gate.crashing.org> In-Reply-To: <20210824161450.GI1583@gate.crashing.org> From: "H.J. Lu" Date: Tue, 24 Aug 2021 10:03:05 -0700 Message-ID: Subject: Re: [PATCH v2] x86: Allow CONST_VECTOR for vector load in combine To: Segher Boessenkool Cc: Hongtao Liu , GCC Patches , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2021 17:03:53 -0000 On Tue, Aug 24, 2021 at 9:16 AM Segher Boessenkool wrote: > > On Tue, Aug 24, 2021 at 09:57:52AM +0800, Hongtao Liu wrote: > > Trying 5 -> 7: > > 5: r85:V4SF=[`*.LC0'] > > REG_EQUAL const_vector > > 7: r84:V4SF=vec_select(vec_concat(r85:V4SF,r85:V4SF),parallel) > > REG_DEAD r85:V4SF > > REG_EQUAL const_vector > > Failed to match this instruction: > > (set (reg:V4SF 84) > > (const_vector:V4SF [ > > (const_double:SF 3.0e+0 [0x0.cp+2]) > > (const_double:SF 2.0e+0 [0x0.8p+2]) > > (const_double:SF 4.0e+0 [0x0.8p+3]) > > (const_double:SF 1.0e+0 [0x0.8p+1]) > > ])) > > > > (insn 5 2 7 2 (set (reg:V4SF 85) > > (mem/u/c:V4SF (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S16 > > A128])) "/export/users/liuhongt/install/git_trunk_master_native/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/xmmintrin.h":746:19 > > 1600 {movv4sf_internal} > > (expr_list:REG_EQUAL (const_vector:V4SF [ > > (const_double:SF 4.0e+0 [0x0.8p+3]) > > (const_double:SF 3.0e+0 [0x0.cp+2]) > > (const_double:SF 2.0e+0 [0x0.8p+2]) > > (const_double:SF 1.0e+0 [0x0.8p+1]) > > ]) > > (nil))) > > (insn 7 5 11 2 (set (reg:V4SF 84) > > (vec_select:V4SF (vec_concat:V8SF (reg:V4SF 85) > > (reg:V4SF 85)) > > (parallel [ > > (const_int 1 [0x1]) > > (const_int 2 [0x2]) > > (const_int 4 [0x4]) > > (const_int 7 [0x7]) > > ]))) > > "/export/users/liuhongt/install/git_trunk_master_native/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/xmmintrin.h":746:19 > > 3015 {sse_shufps_v4sf} > > (expr_list:REG_DEAD (reg:V4SF 85) > > (expr_list:REG_EQUAL (const_vector:V4SF [ > > (const_double:SF 3.0e+0 [0x0.cp+2]) > > (const_double:SF 2.0e+0 [0x0.8p+2]) > > (const_double:SF 4.0e+0 [0x0.8p+3]) > > (const_double:SF 1.0e+0 [0x0.8p+1]) > > ]) > > (nil)))) > > > > I think pass_combine should be extended to force illegitimate constant > > to constant pool and recog load insn again, It looks like a general > > optimization that better not do it in the backend. > > Patches welcome. You should do this like change_zero_ext is done, and > perhaps make sure you do not introduce new is_just_move insns that can > make 2->2 combinations do the wrong thing. > > Also somehow make this not take exponential time? It looks like this > should onle be done in cases where change_zero_ext is not, and the > reverse, so this will work fine with a little attention to detail. > The combine patch is here: https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578017.html Thanks. -- H.J.