Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Bounds check not optimized out after {r}position on a slice #45964

Closed

Description

@dtolnay

All the unrolling makes it hard for llvm to optimize it out. Sample: https://godbolt.org/g/R9nLvC

#45501 has a fix that involves assume(index < len) but we couldn't quite get it to pass tests. Will need to give it another try with some fresh eyes.

Activity

  1. kennytm commented on Nov 13, 2017

    @kennytm
    Member

    According to #44899 (comment) there was a fix in upstream LLVM. We may reopen the PR if we backport the fix.

  2. arielb1 commented on Nov 13, 2017

    @arielb1
    Contributor

    @kennytm

    I already backported the fix, it's just that someone needs to make an "up the LLVM" PR that includes it.

  3. added
    A-LLVM
    I-slow
    on Nov 14, 2017
  4. added a commit that references this issue on Jan 17, 2018
  5. added a commit that references this issue on Jan 28, 2018
    0119b44
  6. kennytm commented on Feb 14, 2018

    @kennytm
    Member

    Reopening this because of #48209.

    (We can close again if it turns out the assume is not necessary for optimizing out the bounds check on LLVM 6.)

  7. added
    C-enhancement
    T-compiler
    on Feb 19, 2018
  8. scottmcm commented on Apr 1, 2018

    @scottmcm
    Member

    It's possible #49551 could help with this, as it should make it easier for LLVM to understand the length of a slice iterator 🤞

  9. arthurprs commented on Apr 1, 2018

    @arthurprs
    Contributor

    I think this can be closed, they put the assume back after patching LLVM.

  10. arielb1 commented on Apr 1, 2018

    @arielb1
    Contributor

    Could we have a codegen test? I'm marking this as E-needstest.

  11. added
    E-needs-test
    on Apr 1, 2018
  12. added a commit that references this issue on Oct 26, 2020
  13. added a commit that references this issue on Oct 26, 2020
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

    A-LLVMC-enhancementE-needs-testI-slowT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions