[PATCH] D50906: Update MemorySSA in LoopInstSimplify.
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 20 13:43:34 PDT 2018
chandlerc added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopInstSimplify.cpp:80-82
+ MemorySSA *MSSA = nullptr;
+ if (MSSAU)
+ MSSA = MSSAU->getMemorySSA();
----------------
Can be written simpler as:
```
MemorySSA *MSSA = MSSAU ? MSSAU->getMemorySSA() : nullptr;
```
================
Comment at: lib/Transforms/Scalar/LoopInstSimplify.cpp:141
+ if (MemoryAccess *MA = MSSA->getMemoryAccess(&I))
+ if (Instruction *IR = dyn_cast_or_null<Instruction>(V))
+ if (MemoryAccess *MAR = MSSA->getMemoryAccess(IR))
----------------
IR seems weird as a variable name here?
Maybe `SimplifiedI` or `SimpleI`? Also, does it make sense to test this before `getMemoryAccess`?
================
Comment at: lib/Transforms/Scalar/LoopInstSimplify.cpp:200
+ MemorySSA *MSSA = nullptr;
+ std::unique_ptr<MemorySSAUpdater> MSSAUpdater;
+ if (EnableMSSALoopDependency) {
----------------
We we really want a unique_ptr instead of an Optional?
Repository:
rL LLVM
https://reviews.llvm.org/D50906
More information about the llvm-commits
mailing list