Coder Social home page Coder Social logo

Comments (4)

thvnx avatar thvnx commented on June 25, 2024

Hi,

This little project is a work in progress that doesn't progress... it does nothing yet. My goal is to reimplement the work I've done during my PhD: https://hal.archives-ouvertes.fr/hal-01236919.

I don't think there is any documentation for this, you'll have to take a look at the example that you can find in the llvm-project source tree: llvm-project/clang-tools-extra/.

You can find here some tools that can optimize source code expressions (floating-point arithmetic oriented): https://fpbench.org/community.html

from clang-fco.

cesss avatar cesss commented on June 25, 2024

Thanks a lot for your reply, @thvnx ! By looking at the link with optimization tools, it seems like all of them are related to mixed-precision and to optimization as means of finding an optimal precision for the calculation being done.

However, my interest is in the kind of optimizations that compilers usually perform: exchanging operators (ie: turn divisions into multiplications when possible, change multiplications by additions or vice versa, changing multiplications by powers of 2 into shifts in integers, etc...), completely transforming the expression into another one. Granted, some of these optimizations can have a negative impact in accuracy -or positive in some cases-, and some of them can even violate standards compliance, but most compilers let the user decide the level of optimization from safest to most aggressive, from compliant to not-necessarily compliant, etc...

Do you know of any tool capable of doing this at a source code level rather than at a CPU instructions level?

from clang-fco.

thvnx avatar thvnx commented on June 25, 2024

I don't know if such a tool exists, nevertheless a clang tool can be "quickly" prototyped to do so.

from clang-fco.

cesss avatar cesss commented on June 25, 2024

Thanks a lot! In this moment I tend to believe that what would be needed would be a custom builtin type rather than a source-to-source transformation tool, so I have asked at llvm-dev hoping somebody can help: https://lists.llvm.org/pipermail/llvm-dev/2020-April/141046.html

But I feel like I'm not going to get many replies. It's somewhat strange, because there are C++ classes for emulating 16bit half floats and 128bit "quad" floats, but when you use them, you not only lose the hardware performance from the FP unit in the CPU, but you also lose all arithmetic optimizations... I feel it very strange that nobody seems to have developed a solution for this.

A similar problem could be discussed for matrix algebra: you can overload C++ operators for correctly implement matrix algebra expressions, but then the optimizer is not able to rearrange your expressions for speed, because the C++ standard doesn't let you define a semantic meaning for the operators...

Well, I'm closing this, as this obviously is not an issue about your software :-)

Thanks a lot!

from clang-fco.

Related Issues (1)

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.