From patchwork Tue Oct 24 02:21:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 157228 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1673108vqx; Mon, 23 Oct 2023 19:22:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFH4gq9Lq8W0Pjd+s8r5ROB5vAPsDSnPCASOxxyOddUHJG9tBtKTjWvAPZ3uDViXASU7UTF X-Received: by 2002:a05:622a:452:b0:40f:2e2c:6df4 with SMTP id o18-20020a05622a045200b0040f2e2c6df4mr14030128qtx.6.1698114140016; Mon, 23 Oct 2023 19:22:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698114140; cv=pass; d=google.com; s=arc-20160816; b=KXKSOfwB+EsRObF4lGBuGlIuCH6Dja7HwSdIQ9kAK17CxUuUxqXirJcn2sVZLmj4ao BCo6eWm6GKsijCcGLI0b0Ww+JLBfVPB+A0CFVhNqB+pGqHz9FRbc8R495jZIk6NUafmg 6ncY33xXsYRRCMIkpAl56kzgz5hZrgK48lnavM5OhSh4/BCwqhkmKagbRSqWed24C4WS QTffPz5+KWkI9qX0y7uFvyMX8D161Csch3AtKkl28ZvkCeg+jRr1eVMlf8ZwM9GT+5OH muLdLDuKAR+T9/eLhG2i8QOg0dk+zO5TmngXgOD8x8ymV/88hm1DQmGcW0VyAQMhzFMY PpPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-filter:dmarc-filter:delivered-to; bh=Qk8iQFX1L4Yh46oBNuaEy0Da3AJRHKSiwgl8ZQ57ijM=; fh=12MRPJmZ1mgDpHqWoogMKqnaGRGM2b7lcuJroqfjJiw=; b=UkEWzHjRoJF0x968PMIKSwirtG/jc8hzHs6I7FzqOUOx7KYmTo3XSjZTaZSI/lXdDP GWjFNPG91fYfC4+VbDtJRbRcCHaXMWsgUSHmBzAFvHHIaAaNXIhPKPRkwcDxuFgCsr9d cLmFe0l39EUtU500aBRqVi3FPc4jzQ4WLIboIO1jO7ONw+gxknBMpx+1sl+3UuOW6d4R l0MxMzo5XbMfFGaj2KyCIVmcXZj0NB7t3YehSihWSg6f5miuhQX7Ka894RGMHcET/qkO SzES2tsXG67WsSqUh3p40a1i3QblprsPGAbaeCNLzrKIEjAeJyctC/fLW6Mn1Kokakxa ytCg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g11-20020ac87d0b000000b0041cc117cfadsi6653316qtb.338.2023.10.23.19.22.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 19:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6CAC385C421 for ; Tue, 24 Oct 2023 02:22:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by sourceware.org (Postfix) with ESMTPS id BEF313858D39 for ; Tue, 24 Oct 2023 02:21:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEF313858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BEF313858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.207.19.206 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698114115; cv=none; b=L9zNuRFeQL5oiE+spPa/MgcvNmxXiCkcdmgzKkS3hWVnBT/QZaAE8gCtEyzRtVowRCRL+r3aRsgd950P31OtvMVIWgrykKtYdbW+IZS8ujNJ1bkGkdbF1EMhNPbLxI9xBB3lycdQ4VZ5AZNZPt7lx7EAK+WJ3zI/52x4R8g+xIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698114115; c=relaxed/simple; bh=LKJLUvLiP7AoU09fU7BOZFgyQlZAKx4rZKuJincJOLI=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=g+3Aw2HlR+milFsUai9IpiNH9I08A+qEN6XGXl/Uk6orJd3GUoepkjkK2hdT88f1Mj4824CHNSw2+1qePJk6ozt+cBLJ1/tmGNopNsxAL469fZEY3+x0TZ+TH0i1r3+sCOV8xASkAi+BCI9FfLv6mqMotlqDydcZOZn4mNGAPh8= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp88t1698114102tplcqm6o Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 24 Oct 2023 10:21:41 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: dK5Jr2zGJUNskyjpfIhSHfhFYzQaHi2VFs3oo7Wjw30Eky+Yz8BdhxEaiVAqt JYlXipNr6mNlCk4zAaljmcvT3alxxToJTiv3tEX1RVVMd09o7a7SvBiaz0iMmIePRwvMMln qiSyn65GEELMx7PwXuRtjEB+C9HUJJRSfDdkt3eNQn5SCIz37wqSxKQ8FN4T1Xew4VXlanA GTR/mU5Um4rz0I2AsJfhWZXIPi4l7EMP6EBd9VLm73Uxdl/EE25RdBSuzSS7Zx6sMXODzcQ 840FffOG9LFKK0WVtJyVbaVXAOBWQETegORb94XYb6MLR2pxYJqJOUfynBAaQXyWmhRJOBo /yLQrK5eUWEg488RugDjihDFrCZviSKpb6rFLmmSSWfEyxJR1B0ugzjELKsraZgk0HAtrMK XSf+CbF6+OQ= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 4494402087268983795 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [Committed] RISC-V: Fix ICE of RTL CHECK on VSETVL PASS[PR111947] Date: Tue, 24 Oct 2023 10:21:39 +0800 Message-Id: <20231024022139.218915-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780601732431583508 X-GMAIL-MSGID: 1780601732431583508 ICE on vsetvli a5, 8 instruction demand info. The AVL is const_int 8 which ICE on RENGO caller. Committed as it is obvious fix. PR target/111947 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pre_vsetvl::compute_lcm_local_properties): Add REGNO check. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/pr111947.c: New test. --- gcc/config/riscv/riscv-vsetvl.cc | 15 +++++++++------ .../gcc.target/riscv/rvv/vsetvl/pr111947.c | 13 +++++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111947.c diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 5ef0f726e4a..f2f19e423bf 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -2633,13 +2633,16 @@ pre_vsetvl::compute_lcm_local_properties () if (!info.has_nonvlmax_reg_avl () && !info.has_vl ()) continue; - unsigned int regno; - sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_BITMAP (m_reg_def_loc[bb->index ()], 0, regno, - sbi) + if (info.has_nonvlmax_reg_avl ()) { - if (regno == REGNO (info.get_avl ())) - bitmap_clear_bit (m_transp[bb->index ()], i); + unsigned int regno; + sbitmap_iterator sbi; + EXECUTE_IF_SET_IN_BITMAP (m_reg_def_loc[bb->index ()], 0, + regno, sbi) + { + if (regno == REGNO (info.get_avl ())) + bitmap_clear_bit (m_transp[bb->index ()], i); + } } for (const insn_info *insn : bb->real_nondebug_insns ()) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111947.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111947.c new file mode 100644 index 00000000000..cea19b70e20 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111947.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d -O2 -Wno-implicit-int" } */ + +char *a; +b() { + int c[2]; + int d = 0; + for (; d < 16; d += 2) + c[d / 2] = a[d | 1]; + if (c[0]) + for (;;) + ; +}