[llvm-bugs] [Bug 32997] New: [Polly - AST Generation] Use != for upper loop bound
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 10 23:32:31 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32997
Bug ID: 32997
Summary: [Polly - AST Generation] Use != for upper loop bound
Product: Polly
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: isl
Assignee: polly-dev at googlegroups.com
Reporter: tobias at grosser.es
CC: llvm-bugs at lists.llvm.org
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170511/7081c20d/attachment.html>
More information about the llvm-bugs
mailing list