[PATCH] D69470: [ExpandReductions] Don't push all intrinsics to the worklist. Just push reductions.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 07:47:50 PDT 2019


spatel added inline comments.


================
Comment at: llvm/lib/CodeGen/ExpandReductions.cpp:81
   SmallVector<IntrinsicInst *, 4> Worklist;
-  for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
-    if (auto II = dyn_cast<IntrinsicInst>(&*I))
-      Worklist.push_back(II);
+  for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
+    if (auto II = dyn_cast<IntrinsicInst>(&*I)) {
----------------
Could reduce with something like:
  for (auto &I : instructions(F)) {

Note - either way, this pass may be in danger of dying if used on unreachable blocks that contain weird IR. 
See for example: D67766


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69470





More information about the llvm-commits mailing list