[PATCH] D35663: [Polly] Remove dependency of `Scop::getStmtFor(Inst)` on `getStmtFor(BB)`. [NFC].
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 02:16:31 PDT 2017
Meinersbur added inline comments.
================
Comment at: lib/Transform/ForwardOpTree.cpp:669
- if (!DefStmt)
- DefStmt = S->getStmtFor(Inst);
- assert(DefStmt && "Value must be defined somewhere");
+ if (!DefStmt && !(DefStmt = S->getStmtFor(Inst)))
+ return FD_CannotForward;
----------------
Please don't use assignments in conditionals (unless its an initializer of an inline variable declaration). It's hard to see whether its a typo of (`==`) or meant to have side-effects.
https://reviews.llvm.org/D35663
More information about the llvm-commits
mailing list