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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 12:50:54 PST 2023


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM with a couple minor comments



================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:819
+    // the use above the def.
+    if (std::find(T->user_begin(), T->user_end(), Insn) != T->user_end())
+      continue;
----------------
`if (is_contained(T->users(), Insn))`


================
Comment at: llvm/test/Transforms/GVNHoist/hoist-call.ll:139
+entry:
+  callbr void asm "", "=*m,!i"(ptr elementtype(i32) @x)
+  to label %a [label %b]
----------------
I just verified that if you mark this callbr "readnone", hoisting happens.  Please adjust the testcase to demonstrate that hoisting.


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