[PATCH] D116200: [instcombine] Allow sinking of calls with known writes to uses

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 11:15:23 PST 2022


reames added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3772
+      return false;
+    auto *AI = dyn_cast<AllocaInst>(Dest->Ptr->stripPointerCasts());
+    if (!AI)
----------------
reames wrote:
> nikic wrote:
> > FWIW this could also use getUnderlyingObject() instead, as we don't care that the start of the alloca in particular is passed to the function, having an offset is fine.
> Without handling for GEP below, underlying object doesn't gain us anything.  I was planning on leaving offsets to a follow up patch with separate testing.  
Ignore this comment.  My brain was out of sync with the code, we do have GEP below.  


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

https://reviews.llvm.org/D116200



More information about the llvm-commits mailing list