Code Monkey home page Code Monkey logo

Comments (1)

rlyerly avatar rlyerly commented on June 12, 2024

More background

The rematerializing code is built to cheaply reproduce a small number of values for a single instruction. Since almost all machine instructions only use a handful of values, reproducing this small set of values right before the instruction doesn't normally cause issues. The rematerialization code creates small live ranges containing the remat instruction and its use, and prevents if from being evicted or spilled again.

The stackmap intrinsic violates the assumption of a few small values and can have a large number of live values that are rematerialized just for inclusion in the stackmap. This depletes the pool of available registers, causing this error. Note that this issue isn't encountered for call instructions which take a large number of values -- they are custom lowered so that all argument registers are filled and any remaining arguments are spilled to the stack appropriately.

See [1] for more information.

Quick and dirty workaround

The root cause of this issue is a large number of live values across stackmaps. Optimizations exacerbate this problem (as they often trade time for space or increased code size); in particular, inlining seems to cause this in some instances. Compiling with -fno-inline may work around the issue. If not, turning the optimization level to -O0 may also eliminate the issue.

[1] "LLVM Register Allocation" https://www.slideshare.net/chimerawang/llvm-register-allocation-59885569

from popcorn-compiler.

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.