Comments (4)
I think that whichever way we go (names, indices, or pointers), we should go towards only using strings for debugging purposes and using integers for identification purposes, since that would speep up the compiler (a bit like string interning but without using strings in the first place). So comparing two variables should only cost a quick integer comparison instead of the current string comparison which is costly. For example if we keep a "name-based" representation an identifier could be:
case class Identifier(tag: String, id: Int) {
def toString = s"$tag$id"
def equals(other) = this.id == other.id
def hashCode() = id.hashCode()
}
So when you look at a program as a human you might see variables tile0
, tile1
and x2
, but our compiler would only really care about variables 0
, 1
and 2
for processing.
from shine.
We could also add to this issue the question of whether we want to use nameless representations such as DeBruijn indices or Abstract Syntax Graphs.
from shine.
@Bastacyclop I find this a good idea, and it looks like it should be relatively easy to implement. I will open an issue.
from shine.
note: after #214 and related equality saturation PRs, it should be possible to implement enforcing unique names as going through the DeBruijn representation:
def rename(e: core.Expr): core.Expr = eqsat.Expr.toNamedUnique(eqsat.Expr.fromNamed(e))
from shine.
Related Issues (20)
- Non-blocking clEnqueueWriteBuffer does not work in the runtime HOT 6
- Memory re-use for nested reductions
- Distributed arrays implementation bug
- Unnecessary end-of-loop barriers HOT 1
- GEMV N reduction loop should not be unrolled
- [BUG] HarrisCornerDetection Tuning Nat vs. Int HOT 2
- [BUG] Host-code generation collects too many inputs HOT 1
- [BUG] rule annotation breaks rewriting HOT 3
- Auto tuning executor uses global best variable
- Use of opencl local address space instead of private in nvidia mm version HOT 4
- Ensuring that barriers are encountered by all work-items
- Precision of dependency analysis for barrier insertion
- Low-level Rise sanity check HOT 1
- Records of variable length arrays do not generate valid code
- Some Lift programs do not have valid access annotations in Rise
- Update function casting syntax after move to Scala 3
- Support hoisting local memory outside of global parallelism
- [BUG] test failed HOT 2
- [BUG] Unknown OpenCL error happened when running a cgo17 app example HOT 3
- [FEATURE REQUEST] Grammar for the "internal representation" and other tips and tricks for targetting RISE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shine.