[PATCH] [Polly][Fix] Handle wrap rounds in the loop bounds given by ScalarEvolution.

David Peixotto dpeixott at codeaurora.org
Tue Oct 14 10:26:36 PDT 2014


This patch makes me nervous because I don't see why it is obviously safe to always promote to the next size without changing semantics. For example, with this loop:

  for (uint8_t i = 1; i != 0; ++i)
    A[i] += 1;

If we blindly promote to `uint16_t` in the c source then we have definitely changed the trip count.

We handle this case by bailing out in ScopDetection. I think that is a safe first way to fix the bug.

http://reviews.llvm.org/D5728






More information about the llvm-commits mailing list