Comments (3)
@bhelyer @deadalnix I can see some code for this in libd/src/d/semantic/vrp.d . Is this based on Jason Patterson's method or it is dominator tree based approach ? In which files this is used for simplification ? Is CTFE a probable candidate ?
from sdc.
I'm not sure what you mean. VRP is used when casting from an integral type to a smaller integral type. It is allowed in D if VRP can prove it is safe. It is called from caster.d as a fallback when regular integral cast fails.
vrp.d is very ad hoc right now, and could win from some improvement.
VRP here doesn't need to take into account flow analysis (that would make the front too slow) and is just exploring the expression tree and gathering possible value ranges.
VRP is also used by the optimizer, and take flow analysis into account, but this is the optimizer's job and is done by LLVM, not the frontend.
from sdc.
@deadalnix Ok I understand what you mean by VRP is used for check before casting.
As you pointed out correctly , compiler optimization VRP and for that matter I am referring very old but useful work http://www.lighterra.com/papers/valuerangeprop/Patterson1995-ValueRangeProp.ps.gz
It is more aggressive than constant propagation. LLVM has implementation for that but not in upstream compiler , it maintained separately by some research group ( as I recall ).
For the purpose of SDC what are some performance improvement ? Do you have any other reference implementation ( any other language) to compare with ?
from sdc.
Related Issues (20)
- Improve Intrinsic's VRP. HOT 1
- Segfault HOT 3
- sdfmt: support for `--offset` and `--length` HOT 1
- sdfmt: support stdin and stdout, together with `--assume-filename` HOT 3
- Decode floats with overflowing mantissa.
- Add a thread cache for the GC's ExtentMap lookups HOT 3
- Resize large GC allocs in place whenever possible.
- Support appendable allocations HOT 3
- Get sdc/sdunit to emit depfiles
- Add support for finalizer in the GC
- Implement a thread cache for GC allocations. HOT 2
- Keep track of dirty regions HOT 1
- Emit object file as fully qualified module names in the current working directory
- sdfmt -i isn't works on Windows HOT 3
- sdlib compilation fails on mac (apple silicon)
- packedfloat tests failing with ldc HOT 6
- valid/test0176 fails under certain environmental conditions HOT 2
- One contract per line
- Realloc huge allocation in place if possible.
- Formatting of functions using `=>` instead of return
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 sdc.