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

compiler: fix cse with different conditionals #2410

Merged
merged 2 commits into from
Jul 16, 2024
Merged

compiler: fix cse with different conditionals #2410

merged 2 commits into from
Jul 16, 2024

Conversation

mloubout
Copy link
Contributor

Fix cse to make sure expression from different conditionals get properly handled.

avoids things like

if (a){
  f1 = expr
 }
if (b){
  f1 = expr
 }

to be converted to

if (a){
  r0 = expr
  f1 = r0
 }
if (b){
  f1 = r0
 }

CSE now counts expression based on the equation's conditional. We could also just lift all rxx out of conditionals but that would be computing those cse temps way more than needed which I don't think it great

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.75%. Comparing base (6e79f1c) to head (a9a4d14).

Files Patch % Lines
devito/passes/clusters/cse.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2410   +/-   ##
=======================================
  Coverage   86.74%   86.75%           
=======================================
  Files         235      235           
  Lines       44563    44610   +47     
  Branches     8250     8257    +7     
=======================================
+ Hits        38657    38702   +45     
- Misses       5187     5189    +2     
  Partials      719      719           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mloubout mloubout force-pushed the cse-conds branch 2 times, most recently from 99fb87e to fc6ee5c Compare July 15, 2024 19:54
tests/test_dse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
devito/passes/clusters/cse.py Outdated Show resolved Hide resolved
@mloubout mloubout force-pushed the cse-conds branch 4 times, most recently from 65d7d69 to 46b15c4 Compare July 16, 2024 13:06
@mloubout mloubout merged commit 3054604 into master Jul 16, 2024
30 of 31 checks passed
@mloubout mloubout deleted the cse-conds branch July 16, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants