[PATCH] D84399: [SCEVExpander] Avoid re-using existing casts if it means updating users.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 11:32:11 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:70
+    if (IP->getParent() == CI->getParent() &&
+        (&*IP == CI || CI->comesBefore(&*IP))) {
+      Ret = CI;
----------------
lebedev.ri wrote:
> Note that `comesBefore()` only handles same-BB cases.
> Should this be something like this instead?
> Note that comesBefore() only handles same-BB cases.

Yep, that's why it checks for being in the same BB. I guess we could, but I'd like to keep the change the least disruptive as possible, to also keep the potential fallout small. IMO changing the BB only reuse would best be done as follow up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84399



More information about the llvm-commits mailing list