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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 12:03:41 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:112
+  // If we skipped past MustDominate, use MustDominate as insertion point.
+  if (IP->getParent() == MustDominate->getParent() &&
+      !IP->comesBefore(MustDominate))
----------------
I'm not sure I understand what's happening here. "I" dominates "MustDominate" because the we're inserting an instruction that uses I. And we're assuming MustDominate itself must be a legal insertion point. So the only way we could skip past MustDominate is if IsInsertedInstruction() is true for MustDominate.

Is it actually possible for isInsertedInstruction(MustDominate) to be true? If it is, could we check it directly?


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