-
Notifications
You must be signed in to change notification settings - Fork 10.6k
fix final problems caused by the rebase to c8ac18d #17217
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 final problems caused by the rebase to c8ac18d #17217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved these checks into the shouldInlinePredicate function, so that we can have different checks for TF and for non-TF inlining.
This is probably not the most correct solution, but it makes all the tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If TF mandatory inlining needs to inline non-transaprent functions, please update the SIL linker in lib/SIL/Linker.cpp and lib/SILOptimizer/UtilityPasses/Link.cpp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slavapestov we should probably do that in a follow-on patch. As of yet, we don't have an attribute to guide that inlining decision. It is guided by structural concerns, so it may be more difficult for us to do. We may have to introduce an attribute for this concept (probably should have long ago).
@marcrasi can you please file a jira to track this for resolution after the merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: https://bugs.swift.org/browse/SR-8015
I'll also add a todo in the code here referencing the issue.
utils/update-checkout-config.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: would you mind reordering these to be in the original order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
utils/update-checkout-config.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pointed these at my forks of the repos, because I don't have commit access to the original repos yet. I'll point these back to the original repos before I merge this PR.
test/TensorFlow/integration.swift
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing that these differences are caused by the switch to guaranteed calling, but could someone confirm that this is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide the full SIL code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's the SIL for the TFPartition Host Result for this function: https://gist.github.com/marcrasi/b2fdaeb542b9b9d307bb49efe14e1406
I also included the TFPartition Host Result for the function that I changed in retain_release.swift, in case you want to look at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
test/TensorFlow/retain_release.swift
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this should be fine as it's add and removing the same # retain/release insts.
lib/AST/ASTPrinter.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cherry-picked this change from master, because it makes a failing test pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1!
lib/SIL/SILPrinter.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just part of the cherry-picked change that I mention above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "noNestedConflict" is what's in the function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (all of them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"noNestedConflict"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"noNestedConflict"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"noNestedConflict"
mhong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in TFUtilities.cpp and TFPartition.cpp look good.
There's one unit test change that I commented out, and can look at more when you provide the full SIL code.
test/TensorFlow/integration.swift
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide the full SIL code?
test/TensorFlow/retain_release.swift
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a heads-up that i've seen piper behave differently in this regard. one option is to replace with {{.*}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileCheck doesn't require that a CHECK matches the entire line, so it should already work no matter what stuff appears in front.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
test/TensorFlow/retain_release.swift
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this should be fine as it's add and removing the same # retain/release insts.
lattner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor formatting changes, thank you!
lib/AST/ASTPrinter.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slavapestov we should probably do that in a follow-on patch. As of yet, we don't have an attribute to guide that inlining decision. It is guided by structural concerns, so it may be more difficult for us to do. We may have to introduce an attribute for this concept (probably should have long ago).
@marcrasi can you please file a jira to track this for resolution after the merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plz wrap after the && to fit in 80 cols.
lib/Sema/CSApply.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plz indent by 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This " Only defined when usesTFEagerAPI == false." comment should be removed.
0fef0df to
9d6175b
Compare
Includes cherry-pick of d093879 to fix a test.
9d6175b to
70b3804
Compare
These fixes make everything compile, and all the test pass.
I'll add github comments in the PR explaining the reasons for some of the changes.
(Note that this PR is into a
tensorflow-rebasebranch, not intotensorflow, so I'll need to do one final step of movingtensorflow-rebaseintotensorflowafter I land this PR).