Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clang][BasicAA][AIE2] Enable full PHI AA for AIE #103

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

andcarminati
Copy link
Collaborator

Also increase the max limit of the search depth in DecomposeGEPExpression. With this change we can allow LICM to hoist more instructions.

Copy link

github-actions bot commented Jun 28, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@andcarminati andcarminati force-pushed the andreu.extend.full.phi branch from fc410ef to 299687c Compare June 28, 2024 13:18
@andcarminati andcarminati force-pushed the andreu.extend.full.phi branch 3 times, most recently from 513b957 to e11ba65 Compare July 4, 2024 14:15
gbossu
gbossu previously approved these changes Jul 8, 2024
Copy link
Collaborator

@gbossu gbossu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through llvm/lib/Analysis/BasicAliasAnalysis.cpp to understand your change within more context. This LGTM! I'm sure it was quite challenging to trace back our problem to here 💪

If possible, I'd be even happier with a simpler additional test case. Maybe a diamond cfg with one non-recursive phi node that has two incoming values, one for each side of the diamond. Would that be enough to show that --basic-aa-full-phi-analysis=false is not enough?

@andcarminati andcarminati force-pushed the andreu.extend.full.phi branch 2 times, most recently from c37a049 to ac3124f Compare July 9, 2024 09:20
@andcarminati
Copy link
Collaborator Author

I looked through llvm/lib/Analysis/BasicAliasAnalysis.cpp to understand your change within more context. This LGTM! I'm sure it was quite challenging to trace back our problem to here 💪

If possible, I'd be even happier with a simpler additional test case. Maybe a diamond cfg with one non-recursive phi node that has two incoming values, one for each side of the diamond. Would that be enough to show that --basic-aa-full-phi-analysis=false is not enough?

Hi @gbossu, I included an additional test. I think now we can clearly see the difference regarding the behavior.

@andcarminati andcarminati force-pushed the andreu.extend.full.phi branch 2 times, most recently from 6309116 to 99297cc Compare July 9, 2024 11:42
gbossu
gbossu previously approved these changes Jul 9, 2024
@andcarminati andcarminati force-pushed the andreu.extend.full.phi branch 3 times, most recently from 1464cd5 to 5d1ff82 Compare July 9, 2024 14:45
gbossu
gbossu previously approved these changes Jul 9, 2024
CC1Args.append({"-mllvm", "-basic-aa-full-phi-analysis=true"});

// Extend the max limit of the search depth in BasicAA
CC1Args.append({"-mllvm", "-basic-aa-max-lookup-search-depth=10"});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we (ie in the average AIE application) wouldn't really notice it if we make it 20, (or 50?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By looking to the statistics I saw this limit being exhausted for one benchmark.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 20 would be better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @martien-de-jong, I believe that 10 is enough for now, considering our benchmarks that are quite complex.

llvm/lib/Analysis/BasicAliasAnalysis.cpp Show resolved Hide resolved
Also increase the max limit of the search depth in DecomposeGEPExpression.
With this change we can allow LICM to hoist more instructions.
Copy link
Collaborator

@gbossu gbossu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!, Are you looking still looking into #103 (comment) ?

@andcarminati
Copy link
Collaborator Author

LGTM!, Are you looking still looking into #103 (comment) ?

I gave a resolution, I think we can keep as 10.

@andcarminati andcarminati merged commit 7549810 into aie-public Jul 23, 2024
8 checks passed
@andcarminati andcarminati deleted the andreu.extend.full.phi branch August 14, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants