This is an archive of the discontinued LLVM Phabricator instance.

[GISel][CSE][NFC]: Handle mutual recursion when inserting node
ClosedPublic

Authored by aditya_nandakumar on Feb 28 2023, 2:10 PM.

Details

Summary

GISel's CSE mechanism lazily inserts instructions into the CSE List to improve on efficiency as well as efficacy of CSE (for allowing partially built instructions to be fully built). There's unfortunately a mutual recursion via
handleRecordedInsts -> handleRecordedInst -> insertNode-> handleRecordedInsts.
So this change simply records that we're already draining this list so we can just bail out on the recursion.
No changes to codegen are expected as we're still draining/handling the temporary list via pop_back and we should get the same sequence of instructions whether we call pop_back in a loop at the top level or recursive.

Diff Detail