Skip to content

loop vectorizer unable to reason with trip count bounds #40306

@llvmbot

Description

@llvmbot
Bugzilla Link 40961
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@fhahn,@hfinkel,@hidekisaito,@RKSimon

Extended Description

I see bugs 38280, 37423, but this one is simpler still. Consider the following:

void topup(int a[], unsigned long i)
{
    for (; i < 16; i++) {
        a[i] = 1;
    }
}

The result, compiled with -O -march=haswell

  • loop is vectorized despite the small absolute limit on trip count
  • vectorized part has loop step of 256 (!) and is actually unreachable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions