[M3devel] what is wrong with TIntN?

Antony Hosking hosking at cs.purdue.edu
Thu Oct 25 16:37:57 CEST 2012


The problem is that you are trying to bring front-end mechanisms into the backend.
If you want to perform optimizations in your backend they should be standalone and independent of the front end.
For example, the llvm backend can perform a whole bunch of optimizations in its own IR.
TInt is a service provided by m3middle to the front-end.
Feel free to add whatever you like to your backend.  I just don’t want to see unnecessary stuff introduced into m3middle.

On Oct 25, 2012, at 4:12 AM, Jay K <jay.krell at cornell.edu> wrote:

> When faced with
> 
> 
> VAR a := FIRST(INTEGER) + 1;
> VAR b := LAST(INTEGER) + 1;
> VAR c := LAST(INTEGER) + 1 - 1;
> VAR d := (a > 0);
> 
> 
> I would like backends to optimize initialization a,
> not optimize initialization of b,
> and probably not optimize initialization of c,
> and hopefully optimize initialization of d, but that is more
> difficult in the C backend.
> 
> 
> Fold constants when it is obviously safe.
> Do not fold constants when there is a chance of overflow -- even
> at intermediate points of the expression.
> 
> 
> This is why I believe TIntN is useful.
> 
> 
> I bring this up because I'm about to add constant folding to M3C.m3.
> And to introduce use of TIntN.
> Which Tony has insisted is wrong, i.e. use in M3x86.m3.
> 
> 
> 
> Thanks,
>  - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20121025/4e658a4c/attachment-0002.html>


More information about the M3devel mailing list