From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by sourceware.org (Postfix) with ESMTPS id 01D58385841E for ; Mon, 6 Sep 2021 11:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 01D58385841E Received: by mail-vs1-xe2e.google.com with SMTP id n63so5230405vsc.11 for ; Mon, 06 Sep 2021 04:10:01 -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=zwlSezS3MGDAEtlPu1au6ibndZ7BGwm9QMT8srtUueg=; b=aBtp4h+JZ0S+OzZv9dIf22ynjIs+lVdsV9H4R+myduwpc/zNt23+va4/YsKR3MWsjo ULB8u0Dt7cYqnThqilkSat8dEJTNfUJN9b16uCRQreaEcb8cSgPvPk9ycVcp7LKcVvTV iW9eEV+5iqyqqhYmHpn5bhJKNKrDPWyd2+JXYpGronfCabhZGjMeiTSYc03/ZvxZ+sBO HH/8AdIQ9TtOooM6SQLOtq/qwwOGRUsqcqqPdAYkTigd7QU2MLGmdgIGhAIGqwn9cOcr Xht4+UGEwI0VOhxSoBu6rdPtFijcMXy1yJ/NHp6L2K+ZJtnd2dZWhw4uR0H5Be/uY12P tQhg== X-Gm-Message-State: AOAM531J+1D+LY1hUmOtmDDQZJGOOyZOxCNV8okKbUDpBjNHmRp6AbMn 2O9hWp44vEg5RF4a2Zmi7M18kjVypQYQ/kftiFE= X-Google-Smtp-Source: ABdhPJzXe1XhyCuOcP1byVcHeAw9dktlaupXzjI6WG9np/mfV9YJg8k8yxKn4W7uyUNCvHUaBWCL2YaW01IJtxu612k= X-Received: by 2002:a05:6102:3f12:: with SMTP id k18mr5404259vsv.14.1630926601677; Mon, 06 Sep 2021 04:10:01 -0700 (PDT) MIME-Version: 1.0 References: <20210906084614.7974-1-hongtao.liu@intel.com> <20210906094127.GQ920497@tucnak> <20210906110141.GS920497@tucnak> In-Reply-To: <20210906110141.GS920497@tucnak> From: Hongtao Liu Date: Mon, 6 Sep 2021 19:15:41 +0800 Message-ID: Subject: Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model. To: Jakub Jelinek Cc: Richard Biener , liuhongt , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Mon, 06 Sep 2021 11:10:03 -0000 On Mon, Sep 6, 2021 at 7:01 PM Jakub Jelinek wrote: > > On Mon, Sep 06, 2021 at 06:58:37PM +0800, Hongtao Liu wrote: > > > process_options would mean it affects only the command line and not > > > __attribute__((optimize ("O2", "ftree-vectorize"))) > > > etc. > > > So, shouldn't it be instead done in default_options_optimization, somewhere > > It seems default_options_optimization is before read_comline_options > > which means it can't handle cmdline option -O2 -ftree-vectorize. > > > > default_options_optimization (opts, opts_set, > > decoded_options, decoded_options_count, > > loc, lang_mask, &handlers, dc); > > > > read_cmdline_options (opts, opts_set, > > decoded_options, decoded_options_count, > > loc, lang_mask, > > &handlers, dc); > > So what about finish_options then? > default_options_optimization has only a single caller that then calls > read_cmdline_options and then finish_options. in finish_options (gdb) p opts_set->x_flag_tree_loop_vectorize $37 = 1 with -O2 -ftree-loop-vectorize, but 1000 if (opts->x_dump_base_name (gdb) p opts_set->x_flag_tree_loop_vectorize $38 = 0 for -O2 -ftree-vectorize??? Any magic for ftree-vectorize w/ EnabledBy??? > > Jakub > -- BR, Hongtao