Skip to content

rustc should output a loop in the IR for initializing arrays #5491

Closed

Description

@thestinger

At the moment [1, ..256] creates 2 * 256 instructions. LLVM will optimize it back to a loop or a memset, but it would better to start with that in the first place and rely on the unrolling heuristics for small loops (which may or not be enabled right now).

Activity

  1. thestinger commented on Mar 24, 2013

    @thestinger
    ContributorAuthor

    Closing in favour of #4694.

  2. added a commit that references this issue on May 2, 2020
  3. added a commit that references this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-slow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions