comp.lang.ada
 help / color / mirror / Atom feed
From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Ada and Number Crunching ?
Date: 24 Feb 1995 17:03:03 GMT
Date: 1995-02-24T17:03:03+00:00	[thread overview]
Message-ID: <3il3g7$1m00@watnews1.watson.ibm.com> (raw)
In-Reply-To: 3ikfqg$6ar@fang.dsto.gov.au

In article <3ikfqg$6ar@fang.dsto.gov.au>, sxc@itd.dsto.gov.au writes: 

|> Actually, I think that Vladimir has an interesting point
|>
|>   Approximately equivalent Ada and C++ programs, when compiled with
|>   compilers that use the same backend / optimiser technology, seem
|>   to run in approximately the same time.
|>
|> Now if there was some way to remove some of the hand-waves in the
|> above, he may be able to arrive at a meaningful datapoint.  For
|> example: 
...
|>   2)  Are the back-end optimisers really identical?  (Do they do
|>   any C++ or Ada specific optimisation?)

Ada provides opportunities for optimization that C++ does not, including: 

   o Better aliasing information.  If an untagged Ada global variable is
     not marked "aliased", assignment to X.all, where access value X
     points to the same type, cannot possibly kill the global variable,
     and vice versa.

   o Information provided by constraints.  This can be effectively
     exploited to eliminate redundant constraint checks.  (In C++, if
     constraint checking is performed, it is done by explicit
     programming, and the compiler may be unable to deduce that a check
     is unnecessary because a redundant check was performed earlier.  If
     a C++ program does not perform run-time checking, the only fair
     comparison is with an Ada program compiled with checks suppressed,
     in which case Ada constraint information may still provide an
     advantage, but not as big an advantage.)

Optimizing back ends used for multiple languages typically rely on the
front end to provide aliasing information.  My understanding is that the
gcc back end also has a hook for the front end to provide range
information.  Does gnat provide this information to the back end, and
does the back end exploit it effectively?

--
Norman H. Cohen    ncohen@watson.ibm.com



      reply	other threads:[~1995-02-24 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3iatre$3t1m@lamar.ColoState.EDU>
     [not found] ` <VLADIMIR.95Feb20234429@speedy.intrepid.com>
1995-02-24 11:27   ` Ada and Number Crunching ? sxc
1995-02-24 17:03     ` Norman H. Cohen [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox