[PATCH] D84327: [SCEVExpander] Add helper to clean up instrs inserted while expanding.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 06:44:32 PDT 2020


fhahn updated this revision to Diff 280095.
fhahn added a comment.

I explored getting rid of the InsertedInstructions vector and instead combine & sort the existing sets.

I think this is probably beneficial, as long as cleaning up remains more uncommon. The removal logic is also updated, to also work for inserted PHIs. The patch now replaces all uses of a rewritten value with undef before removing. This works fine, if all uses  are part of instructions inserted by the expander (which will be removed).

I added an assertion to ensure that, which uncovered a case where the expander actually modifies uses outside of the instructions it creates. This needs to be addressed first, I put up D84399 <https://reviews.llvm.org/D84399>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84327

Files:
  llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84327.280095.patch
Type: text/x-patch
Size: 6859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200723/c1ba19a2/attachment.bin>


More information about the llvm-commits mailing list