From patchwork Wed Aug 16 15:34:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9903999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 600A660231 for ; Wed, 16 Aug 2017 15:35:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5222922B27 for ; Wed, 16 Aug 2017 15:35:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46FA2286AC; Wed, 16 Aug 2017 15:35:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDA4022B27 for ; Wed, 16 Aug 2017 15:35:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbdHPPfp (ORCPT ); Wed, 16 Aug 2017 11:35:45 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34131 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdHPPfp (ORCPT ); Wed, 16 Aug 2017 11:35:45 -0400 Received: by mail-wr0-f194.google.com with SMTP id x43so3698554wrb.1 for ; Wed, 16 Aug 2017 08:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ugwH88wZ29mFL1eFPxDT7iMPHOexiX7cQ3ITXMPoOyU=; b=fIPVkjWxBPWboYBGfDghI6rgMubusaVgzfWJxEt7NI0DzQ2LYl0wCFAGlU/6DcNz9D i1bpwldoEs1Lb7ZrtX8opcf5vyZyvLu696OepbQcB9XX9VGhJatMNPvPbYLlhJdLLLVs 6sElnsqqD4HZCp4NagguV5zDAB343xxA5Ho8J0PDODZhXIB1f2x22i6juTmoKhnL6q0s XFjdF4E/vSSpLUUHmJFRyef8p8u4MvaeVEQWjpWoKO03Ot9c70Su7uAH7NxrXkgu0M8w pP4D9ETZl/N0K2DXRY3owEU9MxoTXtcJbUVvwn07sBHM4NQI7PGOS14huurtjqHy27In eBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ugwH88wZ29mFL1eFPxDT7iMPHOexiX7cQ3ITXMPoOyU=; b=O7o3+mFyHe4TWIpMAUs+fU9wjy6qZJzsCaXpBtr8uRcZxZHidTBew2AkpPJGfzaT2l U28gexrW8jCaXtCtSDt1SBkjxyB3tnJnuuRrg10WFdrOLI0XOWzgH2NWVztomifAYVbx h5z7T2/8w+gi5sOKsMlrFxjZ2BHC2zZX30R2OTVILGN9KLAQ1gITctHxRpGvtfb/GtPg ubckXJd58MIaf1lGfEzUVUBvMr1c5E9nGCGgxt8kn29vJmfB85oBZ2MKd99qly9Mzs+R ZGOg3g1UFzkRHa2d/Jz5myFfxbllz4IxJ7GfNvY4wIkIYSU914ILvllsXODRSL4Nltpp pN2A== X-Gm-Message-State: AHYfb5i5Rd3MDwopr3yfTEzY24hJFtCXr9IGHjedS+bZk7XpYwVViGjP uKFBjY7o0JceimQZUTI= X-Received: by 10.80.173.227 with SMTP id b32mr2346774edd.81.1502897743706; Wed, 16 Aug 2017 08:35:43 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:4076:600:895a:bb88:13f:9772]) by smtp.gmail.com with ESMTPSA id y19sm690635edi.6.2017.08.16.08.35.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 08:35:43 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Linus Torvalds , Christopher Li , Luc Van Oostenryck Subject: [PATCH 20/29] sssa: add needed new members Date: Wed, 16 Aug 2017 17:34:46 +0200 Message-Id: <20170816153455.97693-21-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170816153455.97693-1-luc.vanoostenryck@gmail.com> References: <20170816153455.97693-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The incoming new method to construct the SSA needs a few new members for pseudos, basic_blocks & symbols. Signed-off-by: Luc Van Oostenryck --- linearize.h | 12 +++++++++++- symbol.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/linearize.h b/linearize.h index a550035d3..30f34aa8f 100644 --- a/linearize.h +++ b/linearize.h @@ -6,6 +6,7 @@ #include "token.h" #include "parse.h" #include "symbol.h" +#include "ptrmap.h" struct instruction; DECLARE_PTR_LIST(pseudo_ptr_list, pseudo_t); @@ -18,6 +19,7 @@ struct pseudo_user { DECLARE_ALLOCATOR(pseudo_user); DECLARE_PTR_LIST(pseudo_user_list, struct pseudo_user); +DECLARE_PTRMAP(phi_map, struct basic_block *, pseudo_t); enum pseudo_type { PSEUDO_VOID, @@ -90,6 +92,7 @@ struct instruction { }; struct /* phi_node */ { struct pseudo_list *phi_list; + struct symbol *var; /* SSSA only */ }; struct /* phi source */ { pseudo_t phi_src; @@ -231,7 +234,14 @@ struct basic_block { struct basic_block_list *parents; /* sources */ struct basic_block_list *children; /* destinations */ struct instruction_list *insns; /* Linear list of instructions */ - struct pseudo_list *needs, *defines; + union { + struct { // SSA construction + unsigned int sealed:1; + }; + struct { // liveness + struct pseudo_list *needs, *defines; + }; + }; union { unsigned int nr; /* unique id for label's names */ void *priv; diff --git a/symbol.h b/symbol.h index 3f075c5bc..05a0d801c 100644 --- a/symbol.h +++ b/symbol.h @@ -184,6 +184,7 @@ struct symbol { struct expression *initializer; struct entrypoint *ep; long long value; /* Initial value */ + struct phi_map *phi_map; struct symbol *definition; }; };