[PATCH] D124967: [SROA] Avoid postponing rewriting load/store by ignoring lifetime intrinsics in partition's promotability checking

Dmitry Vassiliev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 12:45:15 PDT 2022


slydiman added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:1993
+      return true;
+  }
+
----------------
nikic wrote:
> These already is a check for `isLifetimeStartOrEnd()` and `isDroppable()` below, only difference is that it's after the `RelEnd > Size` check. I think you'd want to add the `isDroppable()` check here as well, and then drop the IntrinsicInst handling below entirely.
> 
> You can also move the `Use *U = S.getUse();` line before here.
I have moved `Use *U = S.getUse();`.
Please note I cannot move isDroppable() bacause this block depends on the previous block
```
} else if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(U->getUser())) {
```
and such moving will break the current logic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124967



More information about the llvm-commits mailing list