[PATCH] don't unroll loops with zero trip count; fix for PR21409

Sanjay Patel spatel at rotateright.com
Mon Nov 10 13:47:59 PST 2014


Hi hfinkel, atrick, majnemer,

In PR21409 ( http://llvm.org/bugs/show_bug.cgi?id=21409 ), the loop unroller tries to transform a loop with a backedge count of i32 4294967295. Adding 1 to that causes an overflow of the SCEV value for the trip count. This patch adds a check to prevent unrolling that type of loop.

http://reviews.llvm.org/D6200

Files:
  lib/Transforms/Utils/LoopUnrollRuntime.cpp
  test/Transforms/LoopUnroll/runtime-zero-tripcount.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6200.16007.patch
Type: text/x-patch
Size: 2108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141110/1b97f233/attachment.bin>


More information about the llvm-commits mailing list