Skip to content

Conversation

@nickgg
Copy link
Contributor

@nickgg nickgg commented Sep 17, 2020

Adds a pass to the IR Simplifier which fuses together the bodies of Cond statements which have identical conditions. e.g.

if (i < 10) {
  do_thing_1;
} else {
  do_thing_2;
}
if (i < 10) {
  do_thing_3;
}

is transformed into:

if (i < 10) {
  do_thing_1;
  do_thing_3;
} else {
  do_thing_2;
}

Copy link
Contributor

@navahgar navahgar left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me. Just a couple minor corrections in tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

s/j/i to make sure that simplification does not happen because of 10 != 11.

Copy link
Contributor

Choose a reason for hiding this comment

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

s/j/i - same as above to make sure that LT v GT is the problem here.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 17, 2020
@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #44886 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #44886      +/-   ##
==========================================
- Coverage   67.90%   67.89%   -0.01%     
==========================================
  Files         384      384              
  Lines       49890    49890              
==========================================
- Hits        33876    33873       -3     
- Misses      16014    16017       +3     
Impacted Files Coverage Δ
torch/utils/_benchmark/utils/common.py 77.68% <0.00%> (-1.66%) ⬇️
torch/testing/_internal/expecttest.py 77.55% <0.00%> (-1.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d57025...00e48b3. Read the comment docs.

@nickgg
Copy link
Contributor Author

nickgg commented Sep 17, 2020

Good catches, thanks.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@nickgg has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@nickgg merged this pull request in f175830.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants