From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6B5803858D39 for ; Tue, 18 Oct 2022 21:32:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B5803858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666128726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vRPXMeLCx4sJ1dpFJR2/Fx3Ax7fQp/o+plLL4OV8jYI=; b=NJFIaO+iOsDlCTfUa2RzQK5Gg8/WNNulfuYEhRo6KTN35WwimY8cQUjwHM7yZISxIvXsPL YwszHZJH87gZe4oz1jad+YnNxc39+7YPEfKhf15k8jz0i4IWZFsmxcJTUhjrgfUkMmXcem kQKGHzSImIfoEkseCFRK8kuRh4NHWDI= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-9-1kuNnk1WNBG5kGl4Wjq3jQ-1; Tue, 18 Oct 2022 17:32:02 -0400 X-MC-Unique: 1kuNnk1WNBG5kGl4Wjq3jQ-1 Received: by mail-il1-f197.google.com with SMTP id g13-20020a056e021e0d00b002fc57cd18e3so13735359ila.11 for ; Tue, 18 Oct 2022 14:32:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=czTQN76ID74mH5/eAIHumEzsVOWBbcCzjYiKWhx1geQ=; b=1XRiQjCuBQ11aPoiDRukO+y4pYXHgA6zmz/LjO9alEaHON4U4uv/Xhjc5HVRImWwV0 k0CgvOmgt5sFBVmvc4u+5ipVED1z7CqeJ8sKJkIr9IODkFLxgtrTZU1i2R9mV2DoxYS+ hFFKqR15mwlAO+cR4uXpXQPKFXB09e4LeHbE7UTnOreZRUBR9G/pyUT9RMNMuEG4Ad7+ nAsTq2gyWn6rliK4ddcdS7e9GP19HE8fvgQseIYrUbJXcrZVGBDRAVhvg39In9JY/n0v GuH7pVpdhrC+Hb5QiI1YDwmGRS8k/P6n/0066iu3tqPCmCpi6XYbxm5NsqAfiN4LCF4H QhzA== X-Gm-Message-State: ACrzQf06ONPcyTgo+hH26YrkLQ3+T9KHOlNRLmhx+nfZZQkk9oiVcD3d N6fdR8ApcKf1XwB19NaY9HEhmH6mQuCzi/XrU49KySqKjCtRJwIowEmuHJ6fn6h7jyOkWm82FIu iog5HMfTVErfhm/NRpA== X-Received: by 2002:a92:ca49:0:b0:2fc:73d3:d57f with SMTP id q9-20020a92ca49000000b002fc73d3d57fmr3401553ilo.116.1666128721768; Tue, 18 Oct 2022 14:32:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vMgkUDmY7yrmxXK/MMIn9P57S1YC1lumnPEEQFRMrJ70aGdt+LMbTnIjvrqVjUuhmUynKFg== X-Received: by 2002:a92:ca49:0:b0:2fc:73d3:d57f with SMTP id q9-20020a92ca49000000b002fc73d3d57fmr3401531ilo.116.1666128721404; Tue, 18 Oct 2022 14:32:01 -0700 (PDT) Received: from ?IPV6:2607:fea8:a263:f600::50d4? ([2607:fea8:a263:f600::50d4]) by smtp.gmail.com with ESMTPSA id b1-20020a926701000000b002f90d038403sm1334307ilc.63.2022.10.18.14.31.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 14:32:00 -0700 (PDT) Message-ID: <16da3b46-f061-076a-19b5-c482f45477b3@redhat.com> Date: Tue, 18 Oct 2022 17:31:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] middle-end, v4: IFN_ASSUME support [PR106654] To: Jakub Jelinek , Richard Biener Cc: Jan Hubicka , gcc-patches@gcc.gnu.org, "hernandez, aldy" References: <479fa663-fb3e-a90d-ae7a-0fdd5acbfa00@redhat.com> From: Andrew MacLeod In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="------------90M0TcuBCDJLEUKFi7SmMdkr" Content-Language: en-US X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: This is a multi-part message in MIME format. --------------90M0TcuBCDJLEUKFi7SmMdkr Content-Type: multipart/alternative; boundary="------------WHzhSOgLTT2tBaxAiNWcFJnw" --------------WHzhSOgLTT2tBaxAiNWcFJnw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/17/22 11:44, Jakub Jelinek via Gcc-patches wrote: > > Added 2 tests for nested assumptions (one with a simple assumption > nested in complex one, one with side-effects one nested in complex one). > > So far lightly tested, will test fully overnight. > > 2022-10-17 Jakub Jelinek > OK, new prototype update.  I have moved the code to a new "class assume_query" which is still in gimple-range.h We don't need all the heavy lifting of a full on ranger, just an ssa-name table and a gori_compute module.  GORI requires a range_query class, so assume_query derived form that. patch1 is the same/similar infer processing that looks for assume calls and adds any ranges as a side effect. I removed the hack and now its simply returns whetever the global value is, so its no net effect. patch2 is the assume_query class.  When created, it will "process" the current function up front. It currently only works on function with a single integral return statement.  It should never fail, it'll simpy return VARYING for anything it cant determine a value for, or if its an inappropriate function. When its create, you can then query using   bool assume_range_p (vrange &r, tree name); the value of any ssa-name in the function.   They are all pre-calculated, so this is simply picking up any value that was saved. So the good stuff! *Whats now supported?*  It begins with the return statement having a value of [1,1] and begins going back to defs, and evaluating any operands on that statement. PHIs are now processed.   - If an argument is symbolic, we try substituting the LHS for the argument, and go to its def.  continuing the process.   - If an argument is a constant, we check if its compatible with the LHS.       - If the intersection is undefined, then that edge cannot be executed, and it is ignored       - if the is defined, then we examine the predecessor block to see if the exit condition which took this edge provides any useful into. And finally, when the def chain terminates and we cant go any further, it also checks to see if this block has a single predecessor, and if so, if taking the edge to get here was the result of a condition that supplies yet more range info. Caveats.  Im not doing a lot of error checking. If I encounter the definition of an ssa-name a second time, I simply stop.  This avoid infinite loops, and re-doing the same work.  Its unclear to me in a complex case if we might need to do some value merging at merge points, but at this point, we make no attempt.  I'd need to find a case where this was problematic, and I see none yet. *What can you expect? *Using a testcase sample attr-assume-7.C  (and patch 3 which hacks VRP to spit out what values it would find)  it provides the following values: bar()   :   x_3 = x_2(D) + 1;   _4 = x_2(D) <= 41;   return _4; for an assume function, x_2(D) would have a range of [irange] int [-INF, 41] for an assume function, _4 would have a range of [irange] bool [1, 1] baz() | :   x_4 = x_3(D) + 1;   w.0_7 = w;   w.1_8 = w.0_7 + 1;   w = w.1_8;   if (x_4 == 51)     goto ; [INV]   else     goto ; [INV]   :   // predicted unlikely by early return (on trees) predictor.   goto ; [INV]   :   if (x_4 == 53)     goto ; [INV]   else     goto ; [INV]   :   // predicted unlikely by goto predictor.   goto ; [INV]   :   if (x_4 == 64)     goto ; [INV]   else     goto ; [INV]   :   _12 = __cxa_allocate_exception (4);   MEM[(int *)_12] = 1;   __cxa_throw (_12, &_ZTIi, 0B);   :   _10 = x_4 == 43;   :   # _1 = PHI <0(3), _10(8), 0(5)>   return _1; for an assume function, _1 would have a range of [irange] bool [1, 1] for an assume function, x_3(D) would have a range of [irange] int [42, 42] NONZERO 0x2a for an assume function, x_4 would have a range of [irange] int [43, 43] NONZERO 0x2b for an assume function, _10 would have a range of [irange] bool [1, 1] qux()   :   _4 = s.a;   if (_4 == 42)     goto ; [INV]   else     goto ; [INV]   :   _5 = s.b;   if (_5 == 43)     goto ; [INV]   else     goto ; [INV]   :   :   # iftmp.2_1 = PHI <1(3), 0(4)>   return iftmp.2_1; for an assume function, iftmp.2_1 would have a range of [irange] bool [1, 1] for an assume function, _4 would have a range of [irange] int [42, 42] NONZERO 0x2a for an assume function, _5 would have a range of [irange] int [43, 43] NONZERO 0x2b S::foo()   :   _5 = this_4(D)->a;   if (_5 == 42)     goto ; [INV]   else     goto ; [INV]   :   _6 = this_4(D)->b;   if (_6 == 43)     goto ; [INV]   else     goto ; [INV]   :   :   # iftmp.3_1 = PHI <1(3), 0(4)>   return iftmp.3_1; for an assume function, iftmp.3_1 would have a range of [irange] bool [1, 1] for an assume function, _5 would have a range of [irange] int [42, 42] NONZERO 0x2a for an assume function, _6 would have a range of [irange] int [43, 43] NONZERO 0x2b corge()   :   if (x_2(D) <= 41)     goto ; [INV]   else     goto ; [INV]   :   __builtin_unreachable ();   :   _3 = x_2(D) >= -41;   return _3; for an assume function, x_2(D) would have a range of [irange] int [-41, +INF] for an assume function, _3 would have a range of [irange] bool [1, 1] --------------------------------------------------------------------------------------------------------- THis seems to provide a reasonable amount of functionality.  As you can see by the qux() and S:foo() cases, if you can figure out how to map structures and pointers as parameters, we can produce the ranges "produced" when they are loaded.  ie we know _4 is [42,42] and that it was loaded from s.a:   _4 = s.a; Presumably what is needed is a pass (which can be anywhere you want) which invokes an assume_query, and then tries to map the parameter values to ssa-names. Anyway, gives you something to experiement with.   If you would find a different interface useful, let me know, or if there are limitations or other expansions we might need.   This seems like something reasonable for you to start working with? Let me know what you think.   This all bootstraps fine, I could check it into the code base if it helps. Andrew --------------WHzhSOgLTT2tBaxAiNWcFJnw-- --------------90M0TcuBCDJLEUKFi7SmMdkr Content-Type: text/x-patch; charset=UTF-8; name="0001-Infer-support.patch" Content-Disposition: attachment; filename="0001-Infer-support.patch" Content-Transfer-Encoding: base64 RnJvbSAyMDgwNWZiNTRhZWUwZDBlMzM3ZDUzZmFjZjc3YTVjNjZmOWYwYzlj IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBbmRyZXcgTWFjTGVv ZCA8YW1hY2xlb2RAcmVkaGF0LmNvbT4KRGF0ZTogVHVlLCAxOCBPY3QgMjAy MiAxNjoyOTo0OSAtMDQwMApTdWJqZWN0OiBbUEFUQ0ggMS8zXSBJbmZlciBz dXBwb3J0CgotLS0KIGdjYy9naW1wbGUtcmFuZ2UtaW5mZXIuY2MgfCA0OCAr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIDEgZmls ZSBjaGFuZ2VkLCA0OCBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvZ2Nj L2dpbXBsZS1yYW5nZS1pbmZlci5jYyBiL2djYy9naW1wbGUtcmFuZ2UtaW5m ZXIuY2MKaW5kZXggZjBkNjZkMDQ3YTYuLjk1ODM5NDQ1MTU1IDEwMDY0NAot LS0gYS9nY2MvZ2ltcGxlLXJhbmdlLWluZmVyLmNjCisrKyBiL2djYy9naW1w bGUtcmFuZ2UtaW5mZXIuY2MKQEAgLTM2LDYgKzM2LDI1IEBAIGFsb25nIHdp dGggR0NDOyBzZWUgdGhlIGZpbGUgQ09QWUlORzMuICBJZiBub3Qgc2VlCiAj aW5jbHVkZSAiZ2ltcGxlLXdhbGsuaCIKICNpbmNsdWRlICJjZmdhbmFsLmgi CiAKKworLy8gVGhpcyByb3V0aW5lIG5lZWRzIHRvIGJlIHByb3ZpZGVkIHRv IGxvb2sgdXAgYW55IEFTU1VNRSB2YWx1ZXMKKy8vIGZvciBuYW1lIGluIEFT U1VNRV9JR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S5kdW1wIChk dW1wX2ZpbGUpOworCQkgICAgICBmcHV0YyAoJ1xuJywgZHVtcF9maWxlKTsK KwkJICAgIH0KKwkJfQorCSAgICB9CisJfQorICAgIH0KICAgLy8gTG9vayBm b3IgcG9zc2libGUgbm9uLW51bGwgdmFsdWVzLgogICBpZiAoZmxhZ19kZWxl dGVfbnVsbF9wb2ludGVyX2NoZWNrcyAmJiBnaW1wbGVfY29kZSAocykgIT0g R0lNUExFX0FTTQogICAgICAgJiYgIWdpbXBsZV9jbG9iYmVyX3AgKHMpKQot LSAKMi4zNy4zCgo= --------------90M0TcuBCDJLEUKFi7SmMdkr Content-Type: text/x-patch; charset=UTF-8; name="0002-assume_query-support.patch" Content-Disposition: attachment; filename="0002-assume_query-support.patch" Content-Transfer-Encoding: base64 RnJvbSAzZjMyNDZkNWYzMjk3ZjYxZTk2OTk4YTZiYzg3ZWMxZTQwOTIzOGU1 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBbmRyZXcgTWFjTGVv ZCA8YW1hY2xlb2RAcmVkaGF0LmNvbT4KRGF0ZTogVHVlLCAxOCBPY3QgMjAy MiAxNjozMDowNCAtMDQwMApTdWJqZWN0OiBbUEFUQ0ggMi8zXSBhc3N1bWVf cXVlcnkgc3VwcG9ydAoKLS0tCiBnY2MvZ2ltcGxlLXJhbmdlLWdvcmkuaCB8 ICAgNiArLQogZ2NjL2dpbXBsZS1yYW5nZS5jYyAgICAgfCAxNjQgKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKwogZ2NjL2dpbXBs ZS1yYW5nZS5oICAgICAgfCAgMTcgKysrKysKIDMgZmlsZXMgY2hhbmdlZCwg MTg0IGluc2VydGlvbnMoKyksIDMgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0 IGEvZ2NjL2dpbXBsZS1yYW5nZS1nb3JpLmggYi9nY2MvZ2ltcGxlLXJhbmdl LWdvcmkuaAppbmRleCBjN2EzMjE2MmExYi4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ICNlbmRpZiAvLyBHQ0NfR0lNUExFX1JBTkdFX0gKLS0g CjIuMzcuMwoK --------------90M0TcuBCDJLEUKFi7SmMdkr Content-Type: text/x-patch; charset=UTF-8; name="0003-Show-output.patch" Content-Disposition: attachment; filename="0003-Show-output.patch" Content-Transfer-Encoding: base64 RnJvbSA0ZDkyMGJkN2FlNjhmMDRjYjM4Nzg3NWY3MTY5NTUwM2Y0ZGI4NmFl IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBbmRyZXcgTWFjTGVv ZCA8YW1hY2xlb2RAcmVkaGF0LmNvbT4KRGF0ZTogTW9uLCAxNyBPY3QgMjAy MiAxMjoyODoyMSAtMDQwMApTdWJqZWN0OiBbUEFUQ0ggMy8zXSBTaG93IG91 dHB1dAoKLS0tCiBnY2MvdHJlZS12cnAuY2MgfCAyNCArKysrKysrKysrKysr KysrKysrKysrKysKIDEgZmlsZSBjaGFuZ2VkLCAyNCBpbnNlcnRpb25zKCsp CgpkaWZmIC0tZ2l0IGEvZ2NjL3RyZWUtdnJwLmNjIGIvZ2NjL3RyZWUtdnJw LmNjCmluZGV4IDFhZGIxNWM5OTM0Li4zYzBkNWM0MzIxNSAxMDA2NDQKLS0t IGEvZ2NjL3RyZWUtdnJwLmNjCisrKyBiL2djYy90cmVlLXZycC5jYwpAQCAt NDM0NSw2ICs0MzQ1LDMwIEBAIGV4ZWN1dGVfcmFuZ2VyX3ZycCAoc3RydWN0 IGZ1bmN0aW9uICpmdW4sIGJvb2wgd2Fybl9hcnJheV9ib3VuZHNfcCkKICAg c2Nldl9pbml0aWFsaXplICgpOwogICBjYWxjdWxhdGVfZG9taW5hbmNlX2lu Zm8gKENESV9ET01JTkFUT1JTKTsKIAorICBhc3N1bWVfcXVlcnkgKnIyID0g bmV3IGFzc3VtZV9xdWVyeSAoKTsKKyAgZm9yICh1bnNpZ25lZCBpID0gMDsg aSA8IG51bV9zc2FfbmFtZXM7IGkrKykKKyAgICB7CisgICAgICB0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