[PATCH] D143641: [MemorySSA] Recursively check if gep's pointer operand is a guaranteed loop invariant

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 14:22:25 PST 2023


asbirlea added inline comments.


================
Comment at: llvm/lib/Analysis/MemorySSA.cpp:2635
   if (auto *GEP = dyn_cast<GEPOperator>(Ptr)) {
-    return IsGuaranteedLoopInvariantBase(GEP->getPointerOperand()) &&
+    return IsGuaranteedLoopInvariant(GEP->getPointerOperand()) &&
            GEP->hasAllConstantIndices();
----------------
This recursion should not be unbounded, and preferably make it iterative.
A similar example: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/ValueTracking.cpp#L4568


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143641/new/

https://reviews.llvm.org/D143641



More information about the llvm-commits mailing list