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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 07:43:32 PDT 2020


lebedev.ri added a comment.

This looks about right to me. Some thoughts.



================
Comment at: llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h:64
+  /// All instructions inserted during expansion, in insertion order.
+  SmallVector<Instruction *, 8> InsertedInstructions;
+
----------------
Should this also be `AssertingVH`, just to be extra safe?


================
Comment at: llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h:453
+  /// Indicate that the result of the expansion is used.
+  void resultUsed() { ResultUsed = true; }
+};
----------------
This doesn't read as a setter to me i'm afraid.
Maybe either keep `commit()`, or at least `markResultAsUsed()`, or something.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84327





More information about the llvm-commits mailing list