HomePhabricator

[SCEVExpander] Use IRBuilderCallbackInserter to call rememberInstruction.

Authored by fhahn on Jul 23 2020, 6:19 AM.

Description

[SCEVExpander] Use IRBuilderCallbackInserter to call rememberInstruction.

Currently there are plenty of instructions that SCEVExpander creates but
does not track as created. IRBuilder allows specifying a callback
whenever an instruction is inserted. Use this to call
rememberInstruction automatically for each created instruction.

There are still a few rememberInstruction calls remaining, because in
some cases Inst::Create functions are used to construct instructions.

Suggested by @lebedev.ri in D75980.

Reviewers: mkazantsev, reames, sanjoy.google, lebedev.ri

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D84326

Details