[PATCH] D109817: [AggressiveInstCombine] Add `phi` nodes support to `TruncInstCombine`

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 10:54:43 PST 2022


anton-afanasyev marked an inline comment as done.
anton-afanasyev added a comment.

> Are there tests with switches, where the PHI node has multiple incoming edges from the same predecessor?

What do you mean by "the same predecessor"? There is test with ordinary loop.



================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:160
+      for (auto *Op : Operands)
+        if (all_of(Stack, [Op](Value *V) { return Op != V; }))
+          Worklist.push_back(Op);
----------------
lebedev.ri wrote:
> `Stack` should be a SetVector then.
> Also, could use a comment.
`Stack` is already used as stack, we need to push/pop from it.
Added comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109817



More information about the llvm-commits mailing list