This is an archive of the discontinued LLVM Phabricator instance.

Do not mark non-phi loop var def as loop-carried dep
Needs ReviewPublic

Authored by thopre on Dec 15 2022, 2:02 PM.

Details

Reviewers
bcahoon
sgundapa
Summary

As spotted by Sumanth Gundapaneni, commit
c8be35293c82f216e975c56f62ddf9199a22f2e2 incorrectly marked loop
variable not defined by a PHI as loop-carried dependencies. This commit
fixes that.

Diff Detail

Event Timeline

thopre created this revision.Dec 15 2022, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 2:02 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
thopre requested review of this revision.Dec 15 2022, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 2:02 PM
bcahoon added inline comments.Dec 19 2022, 10:35 AM
llvm/lib/CodeGen/MachinePipeliner.cpp
2283

If we don't know the definition for BaseOpsS or BaseOpsD, then we have to be conservative and assume a loop carried dependence.

Perhaps we need to handle two cases, one when BaseOpsS is the same as BaseOpsD, and the other is when they aren't the same.