Giter Club home page Giter Club logo

Comments (3)

vivekvpandya avatar vivekvpandya commented on August 27, 2024

@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.

deadalnix avatar deadalnix commented on August 27, 2024

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.

vivekvpandya avatar vivekvpandya commented on August 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.