[PATCH] D61471: [MemorySSA] Refactor removing multiple trivial phis [NFC].
George Burgess IV via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 15:42:17 PDT 2019
george.burgess.iv accepted this revision.
george.burgess.iv added a comment.
This revision is now accepted and ready to land.
LGTM after two nits; thanks!
================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:358
// Optimize potentially non-minimal phis added in this method.
- for (unsigned Idx = NewPhiIndex; Idx < NewPhiIndexEnd; ++Idx) {
- if (auto *MPhi = cast_or_null<MemoryPhi>(InsertedPHIs[Idx])) {
- auto OperRange = MPhi->operands();
- tryRemoveTrivialPhi(MPhi, OperRange);
- }
- }
+ int NewPhiSize = NewPhiIndexEnd - NewPhiIndex;
+ if (NewPhiSize > 0)
----------------
nit: `unsigned` please, to match with the type of the RHS
================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:360
+ if (NewPhiSize > 0)
+ tryRemoveTrivialPhis(ArrayRef<WeakVH>(&(InsertedPHIs[NewPhiIndex]), NewPhiSize));
----------------
nit: (parens) around `InsertedPHIs[NewPhiIndex]` are unnecessary; please remove
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61471/new/
https://reviews.llvm.org/D61471
More information about the llvm-commits
mailing list