Allow side-effect free function calls in valid affine SCEVs
authorTobias Grosser <tobias@grosser.es>
Sat, 27 May 2017 15:18:46 +0000 (15:18 +0000)
committerTobias Grosser <tobias@grosser.es>
Sat, 27 May 2017 15:18:46 +0000 (15:18 +0000)
commitf5e7e60bc8dc362dd98107d6db41b9b758ecbf20
tree5554c6da98e664f2941fc6bf9f2d1f2b950d8a67
parente3684d0b843303afc16ecd961d7149bcea21eb61
Allow side-effect free function calls in valid affine SCEVs

Side-effect free function calls with only constant parameters can be easily
re-generated and consequently do not prevent us from modeling a SCEV. This
change allows array subscripts to reference function calls such as
'get_global_id()' as used in OpenCL.

We use the function name plus the constant operands to name the parameter. This
is possible as the function name is required and is not dropped in release
builds the same way names of llvm::Values are dropped. We also provide more
readable names for common OpenCL functions, to make it easy to understand the
polyhedral model we generate.

llvm-svn: 304074
polly/include/polly/Support/SCEVValidator.h
polly/lib/Analysis/ScopInfo.cpp
polly/lib/Support/SCEVValidator.cpp
polly/test/ScopInfo/constant_functions_as_unknowns.ll [new file with mode: 0644]