Skip to content

SCEV fails to take advantage of nsw #11781

@nlewycky

Description

@nlewycky
Bugzilla Link 11409
Version trunk
OS Linux
CC @atrick

Extended Description

opt -O2 does a pretty decent job of handling this loop:

int f(int i) { int j, k = 0; for (j = i; j < i + 10; ++j) ++k; return k; }

but it's not taking advantage of the no-signed-wrap property. GCC optimizes it straight down to "return 10".

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