[PATCH] D100265: [Polly][NFC] Refactoring IslAst and partially IslAstInfo to use isl++

Riccardo Mori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 11 10:02:52 PDT 2021


patacca added a comment.

There is the question on how we want to access the `isl::ast_expr` object `RunCondition`.
Right now I declared `RunCondition` as type `isl::ast_expr` so the object lives inside `IslAst` class. Unfortunately the C++ bindings do not define yet the move constructor nor the move assignment so when doing

  RunCondition(std::move(O.RunCondition))
  Condition = IslAst::buildRunCondition(*S, Build)

we are relying on compiler optimizations to copy the data optimally.
I think there is the idea of implementing move constructor and move assignment in the future for isl bindings so it might be ok to just leave the code like this in the mean time.
Otherwise with a little trick we can do r-value assignment like this:

  Condition = isl::manage(O.RunCondition.release())

It feels a bit ugly though.

Another way would be to use `unique_ptr<isl::ast_expr>` instead of the object itself. That way we do not need isl defined move constructor and move assigment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100265/new/

https://reviews.llvm.org/D100265



More information about the llvm-commits mailing list