Skip to content

Bound checks not eliminated in simple cases #39220

Closed
@ghost

Description

I've found several simple cases where bound checks do not get eliminated: https://is.gd/OMzVUa

There are four variants of the same piece of code. It baffles me why bound checks don't get eliminated in the first three functions, and they finally do in the fourth (the function compiles to noop).

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions