[PATCH] D39971: Port ScopInfo to the isl cpp bindings

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 12:10:35 PST 2017


philip.pfaffe created this revision.
Herald added subscribers: kbarton, nemanjai.

Most changes are mechanical, but in two places I changed the program semantics
by fixing bugs, which I'd like a review on.

The first is in `Scop::buildSchedule(Region *, LoopStackTy &, LoopInfo &)`.
Before, we took a reference to `LoopStack.back()` which is a use after free,
since back is popped off further below. This didn't crash before by pure
chance, since LoopStack is actually a vector, and the memory isn't freed upon
pop. I turned this into an iterator-based algorithm.

The second is `Scop::hasFeasibleRuntimeContext()`, where I'm now explicitely
handling the error-case. Before, when the call to
`addNonEmptyDomainConstraints()` returned a null set, this (probably)
accidentally worked because isl_bool_error converts to true. I'm checking for
nullptr now.


https://reviews.llvm.org/D39971

Files:
  include/polly/ScheduleOptimizer.h
  include/polly/ScopInfo.h
  include/polly/Support/GICHelper.h
  include/polly/Support/ISLOStream.h
  lib/Analysis/ScopInfo.cpp
  lib/CodeGen/IslAst.cpp
  lib/CodeGen/IslNodeBuilder.cpp
  lib/CodeGen/PPCGCodeGeneration.cpp
  lib/Exchange/JSONExporter.cpp
  lib/Support/GICHelper.cpp
  lib/Support/SCEVAffinator.cpp
  lib/Transform/FlattenSchedule.cpp
  lib/Transform/ForwardOpTree.cpp
  lib/Transform/ScheduleOptimizer.cpp
  lib/Transform/Simplify.cpp
  unittests/ScheduleOptimizer/ScheduleOptimizerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39971.122697.patch
Type: text/x-patch
Size: 59989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171113/a61d3042/attachment.bin>


More information about the llvm-commits mailing list