[PATCH] D140493: [SROA] Support promotion in presence of variably-indexed loads

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 12:45:14 PST 2022


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:1238-1239
+// but without referencing the alloca itself.
+static Value *getVariableByteOffsetIntoAlloca(LoadInst *LI) {
+  SmallVector<Value *, 8> Stack = getAddressCalculationStack(LI);
+  auto *OrigRoot = cast<AllocaInst>(Stack.pop_back_val());
----------------
We could maintain a cache for these two functions,
but it would only be effective for the current `AllocaSlices`,
so i'm not sure if that is something we want? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140493



More information about the llvm-commits mailing list