[PATCH] D144927: [GVNHoist] don't hoist callbr users into the callbr's block

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 14:06:48 PST 2023


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:819
+    // the use above the def.
+    if (is_contained(T->users(), Insn))
+      continue;
----------------
hiraditya wrote:
> hiraditya wrote:
> > I'm assuming there are only a few `T->users` in practice, otherwise linear search on users could be slow.
> maybe we can check if `Insn` has any operands that are defined by `T`
> I'm assuming there are only a few T->users in practice

In practice, only `CallBrInst`'s are terminators that produce values/can even have users.  In practice, the number of users is 1.

> maybe we can check if Insn has any operands that are defined by T

Equivalent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144927



More information about the llvm-commits mailing list