[M3commit] CVS Update: cm3

Jay K jay.krell at cornell.edu
Sat Mar 13 14:47:57 CET 2010


diff attached


 
> Date: Sat, 13 Mar 2010 14:45:59 +0000
> To: m3commit at elegosoft.com
> From: jkrell at elego.de
> Subject: [M3commit] CVS Update: cm3
> 
> CVSROOT: /usr/cvs
> Changes by: jkrell at birch. 10/03/13 14:45:59
> 
> Modified files:
> cm3/m3-sys/m3front/src/exprs/: CompareExpr.m3 EqualExpr.m3 
> 
> Log message:
> Fairly simple analysis to optimize comparison of subranges
> that either don't overlap at all, or only "on the edge"
> ("on the edge" means the max of one is equal to the min of the other
> or vice versa)
> 
> I don't presume that this really helps much real world code, but
> it is pretty simple so shouldn't hurt.
> Probably it is rare to mix unequal subranges, let alone non-overlapping
> or barely overlapping, as well probably rare to compare subranges to
> constants outside the subrange (or again, "on the edge")
> 
> This handles, integers, longints, enums, constants, but addresses don't work
> e.g. address < NIL should perhaps always be false.
> 
> It seems to me that maybe EqualExpr.m3 and CompareExpr.m3 could be combined somehow?
> I was surprised to see that they are separate.
> 
> It also seemed odd to have to call ConstValue before GetBounds.
> 
> Backends are not directly given the information for them to do this work, though
> more advanced analysis might regain the information.
> subranges and enums just end up as generally unbounded int32, etc.
> (backends do see range checks and can remember what they imply but
> I believe parameters are not range checked upon receipt, for example)
> 
> see test case p233 (though it should probably move to the "c for code" section,
> since running it doesn't do anything, one reads the code and notices that
> many of the functions are optimized to just return a constant true or false)
> 
> This is actually fallout/tangent from not-yet-done work to optimize integer (and possibly other)
> compares in m3back, which has a pretty non-optimal implementation.
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100313/5da5e43b/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1.txt
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100313/5da5e43b/attachment-0002.txt>


More information about the M3commit mailing list