Skip to content

opt hangs in LoadStoreVectorizer #37865

@uabjean

Description

@uabjean
Bugzilla Link 38517
Version trunk
OS Linux
Attachments reproducer with nested load
CC @bevin-hansson,@mikaelholmen

Extended Description

Running
opt -load-store-vectorizer -o tmp.opt.ll tmp.ll
with the attached reproducer, the LoadStoreVectorizer hangs in an endless loop.

The originating src program consists of a nested load, where the inner load's result is used for indexing the outer load.

A somewhat shallow analysis by me indicates that the areConsecutivePointers() function do some SCEV magic to find that the pointers for these loads are consecutive, but it doesn't seem to me that they are. Then when vectorization has been performed, the IR references has a loop, and when the reorder() function is applied to it, it follows that loop endlessly.

This is the original c-program for reference:

#include <stdint.h>

uint32_t a = 0;
uint32_t b[1][3] = { { 0, 0, 0 } };
const uint16_t c = 1;

int main() {
b[(2u & b[a % 1][2u % 3]) % 1][c % 3];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillahangCompiler hang (infinite loop)vectorizers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions