Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Polly - AST Generation] Use != for upper loop bound #32344

Open
tobiasgrosser opened this issue May 11, 2017 · 0 comments
Open

[Polly - AST Generation] Use != for upper loop bound #32344

tobiasgrosser opened this issue May 11, 2017 · 0 comments
Labels
bugzilla Issues migrated from bugzilla polly

Comments

@tobiasgrosser
Copy link
Contributor

Bugzilla Link 32997
Version unspecified
OS Linux

Extended Description

Currently the isl AST generator derives

for (long i = LB; i <= UB; i++)
A[i]

for most loops. An alternative would be to generate

for (long i = LB; i != UB + 1; i++)
A[i]

In the second version a value of LB that is strictly larger than UB + 1 will cause i to eventually overflow. As we know this is not valid (and we annotate i in Polly with NSW), the IR carries the information that such an overflow can never happen
and consequently that LB must be smaller or equal to UB + 1.

LLVM and its -indvars pass prefers the second alternative precisely for this reason.

We should consider to generate IR with the above type.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla polly
Projects
None yet
Development

No branches or pull requests

1 participant