This is an archive of the discontinued LLVM Phabricator instance.

[SCEVExpander] Use IRBuilderCallbackInserter to call rememberInstruction.
ClosedPublic

Authored by fhahn on Jul 22 2020, 7:29 AM.

Details

Summary

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.

Diff Detail

Event Timeline

fhahn created this revision.Jul 22 2020, 7:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2020, 7:29 AM
lebedev.ri accepted this revision.Jul 22 2020, 7:35 AM

This is indeed in-line with what i imagined, and it obviously looks cleaner that way, so LGTM.
Not sure if you want to also wait for other reviewers.

This revision is now accepted and ready to land.Jul 22 2020, 7:35 AM
This revision was automatically updated to reflect the committed changes.