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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 02:43:20 PST 2021


nikic 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
----------------
fhahn wrote:
> nikic wrote:
> > Can be `cast`, user of instruction is always instruction.
> updated, thanks!
Can also drop the `!Use` check.


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