This is an archive of the discontinued LLVM Phabricator instance.

[NFC][LoopInterchange] Clean up of Irrelevant dependency checking using isOuterMostDepPositive.
ClosedPublic

Authored by ram-NK on Aug 30 2022, 3:53 PM.

Details

Summary

The isOuterMostDepPositive() was there to check the negative dependency ('>') of outermost loop.This checking was there before https://github.com/llvm/llvm-project/issues/56275. In https://github.com/llvm/llvm-project/issues/56275 patch, DependenceInfo will make the negative dependency to non-negative (if NeedsNormalize is true). In LoopInterchange, DependenceInfo is used with NeedsNormalize as true. So there will not be any negative dependency in dependency matrix (DepMatrix). So checking the isOuterMostDepPositive is irrelevant (it returns true for negative dependency only).

With this patch all test cases can be passed with negative dependencies. Existing test cases with negative dependency listed below.

  1. pr56275.ll
  2. profitability.ll
  3. loop-interchange-optimization-remarks.ll
  4. interchangeable.ll

Diff Detail

Event Timeline

ram-NK created this revision.Aug 30 2022, 3:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 3:53 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
ram-NK requested review of this revision.Aug 30 2022, 3:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 3:53 PM
fhahn added a subscriber: fhahn.Aug 31 2022, 1:12 AM

Could you please add a description/motivation and a test case?

ram-NK retitled this revision from [LoopInterchange] Unwanted positive dependency checking of Outerloop removed. to [NFC][LoopInterchange] Irrelevant dependency checking using isOuterMostDepPositive..Aug 31 2022, 2:07 PM
ram-NK edited the summary of this revision. (Show Details)
ram-NK added reviewers: bmahjour, Meinersbur, congzhe, Restricted Project, fhahn.
ram-NK set the repository for this revision to rG LLVM Github Monorepo.
ram-NK added a comment.EditedAug 31 2022, 4:19 PM

Could you please add a description/motivation and a test case?

I have added description in SUMMARY. Since it is a NFC, additional test cases are not needed.

ram-NK retitled this revision from [NFC][LoopInterchange] Irrelevant dependency checking using isOuterMostDepPositive. to [NFC][LoopInterchange] Clean up of Irrelevant dependency checking using isOuterMostDepPositive..Sep 1 2022, 7:44 AM
ram-NK edited the summary of this revision. (Show Details)
ram-NK edited the summary of this revision. (Show Details)Sep 1 2022, 1:36 PM
ram-NK added a comment.Sep 9 2022, 7:28 AM

Could you please add a description/motivation and a test case?

I have added description in SUMMARY. Since it is a NFC, additional test cases are not needed.

@fhahn Could you get the chance to review the details and code ?

congzhe accepted this revision.Sep 21 2022, 9:24 AM

LGTM but I'd suggest to wait a couple of days to see if people have other comments. @fhahn would you like to comment on this patch?

This revision is now accepted and ready to land.Sep 21 2022, 9:24 AM