FuelLabs / FuelLabs/sway

Loop Invariant Code Motion (LICM)

Open
#5,367 0 comments 0 reactions 0 assignees View on GitHub
compiler: codegen team:compiler
Dominant language
Rust
Stars
61.4k
Forks
5.4k
Avg merge
3h 33m
Merged PRs (30d)
4

Description

LICM is a standard pass that movies computations that are independent of loop iterations to outside of the loop, so that they aren't executed on each iteration (they need not be).

This requires
1. [IR infrastructure of representing loop constructs](https://github.com/FuelLabs/sway/issues/5368).
3. Run-time gas measurements for impact measurement. The motion is more-or-less code-size neutral.

Parent Issue: #2383

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the prerequisite IR loop infrastructure issue #5368 and the parent issue #2383 to understand the compiler context for LICM. Done means adding the loop-invariant code-motion pass after loop constructs are representable and measuring its runtime gas impact.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.