This is an archive of the discontinued LLVM Phabricator instance.

modify the insertion of freeze instructions for SLU pass
AbandonedPublic

Authored by drcut on Jun 14 2022, 9:54 AM.

Details

Summary

Directly insert the freeze instructions generated by SLU to the place it will be hoisted by LICM. Thus, we do not require LICM as a following pass for SLU.

Diff Detail

Event Timeline

drcut created this revision.Jun 14 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 9:54 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
drcut requested review of this revision.Jun 14 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 9:54 AM
drcut updated this revision to Diff 436850.Jun 14 2022, 10:35 AM

Fix bug for hoisting freeze instruction

fhahn added a comment.Sep 26 2022, 6:09 AM

Hmm, aren't there other places in the code that rely on instructions being hoisted out by LICM? Unless I am mis-remembering, It's not clear to me if/why freeze should be treated in a special way.

drcut added a comment.Sep 26 2022, 6:23 AM

Hmm, aren't there other places in the code that rely on instructions being hoisted out by LICM? Unless I am mis-remembering, It's not clear to me if/why freeze should be treated in a special way.

This patch is related to D127698, for migrating SLU from LoopPass to FuncPass. In the original O3 pipeline, both LICM and SLU are in the same LoopPass Manager. After migrating SLU to FuncPass, it will be removed from the LoopPass Manager. So some loops won't be changed by LICM after applying SLU. Thus, we need to apply parts of LICM in SLU. We found the only instruction we need to hoist is the freeze instruction, as it is the only instruction inserted by SLU.

we've given up on that approach though, it's probably best to abandon these patches as to not confuse people who stumble across this

drcut abandoned this revision.Sep 26 2022, 10:06 AM