[Polly] [ScheduleOptimizer] Prevent incorrect tile size computation
authorSiddharth Bhat <siddu.druid@gmail.com>
Thu, 6 Apr 2017 08:20:22 +0000 (08:20 +0000)
committerSiddharth Bhat <siddu.druid@gmail.com>
Thu, 6 Apr 2017 08:20:22 +0000 (08:20 +0000)
commit5eeb1dd42ef304c6a2f85d3fb9eda03c932f1fe0
treea50e559ddb933e1af67f025be1da375f55634d96
parente6b81315f718d161d740cf2157b9840c4c429473
[Polly] [ScheduleOptimizer] Prevent incorrect tile size computation

Because Polly exposes parameters that directly influence tile size
calculations, one can setup situations like divide-by-zero.

Check against a possible divide-by-zero in getMacroKernelParams
and return early.

Also assert at the end of getMacroKernelParams that the block sizes
computed for matrices are positive (>= 1).

Tags: #polly

Differential Revision: https://reviews.llvm.org/D31708

llvm-svn: 299633
polly/lib/Transform/ScheduleOptimizer.cpp
polly/test/ScheduleOptimizer/ensure-correct-tile-sizes.ll [new file with mode: 0644]