[PATCH] D109917: [InstCombine] Improve TryToSink for side-effecting calls that would be trivially dead

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 06:42:24 PDT 2021


anna added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3667
+  // Cannot move control-flow-involving instructions.
+  if (isa<PHINode>(I) || I->isEHPad() || I->isTerminator())
     return false;
----------------
mkazantsev wrote:
> What if `I` has implicit control flow, e.g. may call system exit?
So, after this transform, we would have some non side-effecting instructions that are executed before this `I` that may call system exit. Why would this matter? 

Note that if we were moving this instruction past some side-effecting (example not marked `willreturn`), there is a problem. But that isn't the case here. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109917



More information about the llvm-commits mailing list