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

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 2 18:24:44 PST 2022


anna added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3803
       return false;
-    for (BasicBlock::iterator Scan = I->getIterator(),
+    for (BasicBlock::iterator Scan = std::next(I->getIterator()),
                               E = I->getParent()->end();
----------------
Just a comment here, I had faced this  exact same issue (the current instruction writing to memory) while trying to support allocation sinking, which I alternatively addressed through `D114648` by adding an extra condition that this check need not be done for `noalias` calls.  

I like the fact that once this change lands I can do allocation sinking using this recently introduced API of `wouldInstructionBeTriviallyDeadOnUnusedPaths`. In other words, we will have a usage of the API in upstream, basically what I was aiming for :) . 



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

https://reviews.llvm.org/D116200



More information about the llvm-commits mailing list