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

Fix braceless if differentiation in reverse mode #1058

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

ovdiiuv
Copy link
Collaborator

@ovdiiuv ovdiiuv commented Aug 24, 2024

As in #1049, the statement inside the braceless if isn't included, causing an error. To avoid that now we check if thenDiff.getStmt_dx() is empty, if so we create if statement with !(orig_cond) condition to ensure correct handling of else if conditions.

Fixes: #1049

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Aug 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.34%. Comparing base (4368c04) to head (3e0f6a4).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1058   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files          55       55           
  Lines        8307     8311    +4     
=======================================
+ Hits         7837     7841    +4     
  Misses        470      470           
Files Coverage Δ
lib/Differentiator/ReverseModeVisitor.cpp 97.89% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
lib/Differentiator/ReverseModeVisitor.cpp 97.89% <100.00%> (+<0.01%) ⬆️

@vgvassilev
Copy link
Owner

Can you add a test to make codecov happy?

@ovdiiuv
Copy link
Collaborator Author

ovdiiuv commented Aug 24, 2024

Can you add a test to make codecov happy?

Yes, I wanted to ask you about that. Should I include the generated code in the tests? Now it only checks if the values are right.

@vgvassilev
Copy link
Owner

Can you add a test to make codecov happy?

Yes, I wanted to ask you about that. Should I include the generated code in the tests? Now it only checks if the values are right.

For this particular change you can add the test in test/Analyses/TBR.cpp.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@ovdiiuv ovdiiuv force-pushed the tbrif branch 2 times, most recently from df060ff to bce9443 Compare August 25, 2024 00:03
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

As in vgvassilev#1049, the statement inside the braceless if is not included causing an error.
Fixes:vgvassilev#1049
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev vgvassilev merged commit 6f4b081 into vgvassilev:master Aug 25, 2024
89 checks passed
@ovdiiuv ovdiiuv deleted the tbrif branch October 4, 2024 16:52
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.

Differentiating increment inside the if body fails with TBR on
2 participants