[PATCH] D35665: [Polly] Remove dependency of `Scop::getLastStmtFor(BB)` on `getStmtFor(BB)`. [NFC].

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 05:57:20 PDT 2017


Meinersbur added a comment.

Looks good, with a single remark.



================
Comment at: lib/Analysis/ScopInfo.cpp:4925-4926
+ScopStmt *Scop::getLastStmtFor(BasicBlock *BB) const {
+  if (getStmtListFor(BB).size() > 0)
+    return getStmtListFor(BB).back();
+  return nullptr;
----------------
This executes `getStmtListFor(BB)` for the same argument twice. Could you store its result in a variable for reuse?


https://reviews.llvm.org/D35665





More information about the llvm-commits mailing list