Giter VIP home page Giter VIP logo

Comments (3)

Trass3r avatar Trass3r commented on July 28, 2024

zext 0 also seems to be common:

%1 = zext i32 0 to i64
store i64 %1, i64* %0

from llvm-mctoll.

bharadwajy avatar bharadwajy commented on July 28, 2024

Indeed the code generated by llvm-mctoll, at present, is not optimal. No effort is yet expended in making raised LLVM IR optimal. One train of thought - for not yet running any optimization passes on the Module Functions - is that the raised output is expected to be consumed and consequently optimized by the clang/llvm to generate native code (potentially for a non-x64 target). The thought is that any optimizations, such as DCE, would be part of this compilation process and is not (yet?) critical for the raised code.

In situations where the raised IR is not intended to be compiled to a native target, I'd expect that one could use LLVM opt tool to run LLVM passes as desired to get a more optimized version.

from llvm-mctoll.

Trass3r avatar Trass3r commented on July 28, 2024

True, that also occurred to me. But you gotta be careful, opt -S -O3 easily optimizes away everything 😄
Even opt -S -instcombine -dce already removes quite some code. Could maybe be added to the readme.
Btw, maybe there could be a mctoll mode that outputs to stdout so it can be directly piped into opt.

from llvm-mctoll.

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.