[PATCH] D12053: [Polly] Workaround for SDiv/SRem referenced from SCEVExpander

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 15 15:47:46 PDT 2015


Meinersbur created this revision.
Meinersbur added reviewers: grosser, jdoerfert.
Meinersbur added subscribers: pollydev, llvm-commits.
Meinersbur added a project: Polly.

polly::SCEVValidator extends the notion of ScalarEvolution values by allowing SDiv and SRem instructions in them. These are handled by polly::SCEVAffinator, but not by llvm::SCEVExpander. SCEVExpander instead references the original values that might be defined only afterwards.

This patch is a workaround by copying those referenceable SDivs/SRems to the polly.start block where the SCEV is expanded and can use the copied instructions. This pessimistically copies values even if not used by any SCoP parameter to avoid making SCEVExpander generate illegal code and recursivity.

Ideally, one introduces SCEVSDiv and SCEVSRem classes to get rid of this and other such workarounds in Polly.

http://reviews.llvm.org/D12053

Files:
  include/polly/CodeGen/IslNodeBuilder.h
  lib/CodeGen/IslNodeBuilder.cpp
  test/Isl/CodeGen/inner_scev.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12053.32223.patch
Type: text/x-patch
Size: 5824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150815/c7cfcc5c/attachment.bin>


More information about the llvm-commits mailing list