From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada 2012 Constraints (WRT an Ada IR) Date: Wed, 30 Nov 2016 16:17:50 -0600 Organization: JSA Research & Innovation Message-ID: References: <8b3ea401-822b-4b51-be48-133861ef2e0b@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1480544213 2692 24.196.82.226 (30 Nov 2016 22:16:53 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 30 Nov 2016 22:16:53 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:32536 Date: 2016-11-30T16:17:50-06:00 List-Id: "Shark8" wrote in message news:8b3ea401-822b-4b51-be48-133861ef2e0b@googlegroups.com... >On Tuesday, November 29, 2016 at 4:52:20 PM UTC-7, Randy Brukardt wrote: >> >> P0 and P1 are more likely to be optimized by a compiler (just because of >> the >> many years of history). Perhaps P3 will catch up, but I wouldn't hold my >> breath on that. > >Oh, BTW, *THIS* is exactly the motivation for having a uniform IR -- when >put into a >common form then all optimizations on that object/construct are applicable. >This is to >say that when P3 and P1 share a representation, every optimization of P1 is >possible >for P3. (Despite syntax differences; again, assuming they're truly >equivalent in the same >way that "Integer > 0" and "Integer in 1..Integer'Last" are.) We don't do any optimizations in the high-level IR (that would be expression trees); that's all done in the conversion to the low-level IR (the stack based machine) or on that IR directly. There's few Ada constructs in the low-level IR. In any case, the semantic description of the two constructs is different, although as far as I know the effect is the same. My experience in Ada is that whenever you think you can collapse Ada constructs, you eventually will be proved wrong, either by a new ACATS test, a customer bug report, or by some future change in the language (either a bug fix or new revision). I would generally reecommend avoiding that as much as possible. Randy.