[PATCH] D50295: Let GetUnderlyingObject use MemorySSA

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 4 05:47:45 PDT 2018


hfinkel added a comment.

Seems like an interesting idea. What's the motivation for doing this?

I'm uneasy with making GetUnderlyingObject fundamentally more powerful than GetUnderlyingObjects - the latter should always provide a superset of the functionality of the former.



================
Comment at: lib/Analysis/ValueTracking.cpp:3512
+            if (MDef->getMemoryInst() != nullptr) {
+              StoreInst *DefI = dyn_cast<StoreInst>(MDef->getMemoryInst());
+              if (DefI && DefI->getValueOperand()->getType()->isPointerTy()) {
----------------
You can use dyn_cast_or_null here:

  if (StoreInst *DefI = dyn_cast_or_null<StoreInst>(MDef->getMemoryInst())) {


Repository:
  rL LLVM

https://reviews.llvm.org/D50295





More information about the llvm-commits mailing list