[PATCH] D152281: [Transforms][LICM] Add the ability to undo unprofitable reassociation

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 02:01:00 PDT 2023


huntergr added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2754-2755
+        Op->setOperand(i, Factored);
+        if (candidates)
+          candidates--;
+        break;
----------------
This seems a little odd, like you might be processing more candidates than you originally identified and want to prevent wrapping?

I think it might be better to see if you can add candidate operations to a SmallVector worklist and process them directly from that instead of walking back through the IR a second time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152281



More information about the llvm-commits mailing list