[PATCH] D113293: [SimplifyCFG] Add early bailout if Use is not in same BB.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 04:58:14 PST 2021


fhahn marked 2 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6530
     // Only look at the first use, avoid hurting compile time with long uselists
-    User *Use = *I->user_begin();
+    auto *Use = dyn_cast<Instruction>(*I->user_begin());
+    // Bail out if Use is not in the same BB as I or Use == I or Use comes
----------------
nikic wrote:
> fhahn wrote:
> > nikic wrote:
> > > Can be `cast`, user of instruction is always instruction.
> > updated, thanks!
> Can also drop the `!Use` check.
Done in the committed version, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113293



More information about the llvm-commits mailing list