From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by sourceware.org (Postfix) with ESMTPS id A69E53858D39 for ; Fri, 1 Jul 2022 09:44:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A69E53858D39 Received: by mail-pj1-f54.google.com with SMTP id d14so2105338pjs.3 for ; Fri, 01 Jul 2022 02:44:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=O7D9HKBjBJQSsvLqrlyu8VjDu3hk0+rtSz0R+jMagLY=; b=0Ed80QQ0b2kuyznzlYfkc6H2VVg7G7ylC0AeoWlDbM4KxX1bVvs0tFN+Q44qeTWhpG 5a26ECPnAbVeDdpLxYhpZ6ab5tv+1fgTTqG7qUY+TnoyF6W2T6DtzXpDCeCMQBXAICy5 aiCvChU7WEiohGdtDouYmFq7u0fNUXvyTjJQuL4XJmnEiGH+OBlTGh3W3jhaBmSAn0dh RiS2K9FrkAWN8Rt9GFc+UoMlPf6kQLCm7ZnqoQpd/s0JxvAw4MWL+sYumFpSZpAeya7g qrCTC0HV2fFvzhMbRXzaVQSTSIX/0nTm/EfH7Q36BeSBEjbkkwN+LJdViG+1q6ikUhlk vH4g== X-Gm-Message-State: AJIora9Ay4jOsKQrGEU3BZLVH6WBkjY7p9CVb1AjSotk+X6j32J+pPZ3 QPYkXgADUFJfFLRRON+3wNDViHmvV8ZzWw== X-Google-Smtp-Source: AGRyM1vj6IHPmMf0y0Mi7uxhaa5sbDtiWdgaztlYBrb+d9AQt9byNVwwR26J7iumVgMTKUn3+GZoHg== X-Received: by 2002:a17:902:ce12:b0:16b:af7d:c2a9 with SMTP id k18-20020a170902ce1200b0016baf7dc2a9mr7572520plg.63.1656668643340; Fri, 01 Jul 2022 02:44:03 -0700 (PDT) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com. [209.85.216.54]) by smtp.gmail.com with ESMTPSA id n67-20020a622746000000b005254eb7627fsm15154694pfn.203.2022.07.01.02.44.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 02:44:03 -0700 (PDT) Received: by mail-pj1-f54.google.com with SMTP id cv13so2098321pjb.4 for ; Fri, 01 Jul 2022 02:44:03 -0700 (PDT) X-Received: by 2002:a17:90b:2391:b0:1ec:a241:5e79 with SMTP id mr17-20020a17090b239100b001eca2415e79mr17295810pjb.24.1656668642791; Fri, 01 Jul 2022 02:44:02 -0700 (PDT) MIME-Version: 1.0 From: Erick Ochoa Date: Fri, 1 Jul 2022 11:46:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Question about speculative make_edge_direct_to_target during LTO/IPA_PASS To: gcc@gcc.gnu.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2022 09:44:06 -0000 Hi, I have a pass that is able to speculate the target of indirect function calls. This pass is an IPA_PASS. It: 1. generates summaries with the possible targets. 2. writes analysis summary 3. reads analysis summary 4. combines the results from multiple partitions and if needed fixes the targets 5. writes opt summary 6. reads opt summary 7. calls ipa_make_edge_direct_to_target with speculative=true This pass is successful in that I can observe the transformation in the generated gimple. (A function test and a direct function call in one branch and the indirect function call in the other.) However, I would like to make the edges in the call graph visible to other IPA passes, particularly ipa-cp. For this, I would need to create virtual clones during the WPA stage. I am a little unfamiliar with virtual clones. What kind of information would I need to store in the analysis summary and is there a way to create speculative virtual clones? Can someone point to a similar piece of code in GCC where this happens? Thanks!