You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/08/25 21:21:52 UTC

[GitHub] [tvm] Lunderberg opened a new pull request, #12607: [TIR] More hygenic TVM_SREF macros

Lunderberg opened a new pull request, #12607:
URL: https://github.com/apache/tvm/pull/12607

   Previously, the `TVM_SREF_TO_BLOCK`, `TVM_SREF_TO_FOR`, and`TVM_TYPE_AS` macros required both the input and output variables.  The input variable name is useful for improving the error message returned, but the output variable name isn't necessary for this functionality, and prevents the macro from being used as part of an expression.
   
   * Generate an immediately-invoked lambda expression to allow for an independently-scoped `result` variable.
   
   * Use parentheses around the input argument, in case the sref is the result of an expression.
   
   * Update all call sites to remove the macro argument providing the first argument.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] Lunderberg commented on pull request #12607: [TIR] More hygenic TVM_SREF macros

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on PR #12607:
URL: https://github.com/apache/tvm/pull/12607#issuecomment-1227775931

   This is currently opened as a draft PR, to see if there are breakages that weren't caught, and whether there should be a rollover from the output-parameter version to the new version.  It's only an internal macro, but it could cause additional merge conflicts with existing PRs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] vinx13 merged pull request #12607: [TIR] More hygenic TVM_SREF macros

Posted by GitBox <gi...@apache.org>.
vinx13 merged PR #12607:
URL: https://github.com/apache/tvm/pull/12607


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] Lunderberg commented on pull request #12607: [TIR] More hygenic TVM_SREF macros

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on PR #12607:
URL: https://github.com/apache/tvm/pull/12607#issuecomment-1227887259

   Cool, cool!  I wasn't sure if there were other benefits to the macro that I had been missing, and wanted to be careful about breakage when tromping on a less familiar part of the codebase.
   
   Regarding inlining, my understanding is that lambdas can always be inlined by the as-if rule, and their limited scope usually lets the compiler be more aggressive about inlining than for normal functions.  I hadn't ever verified this from the assembly before, but a couple of quick godbolt comparisons ([function call not marked inline](https://godbolt.org/z/njG1fK6oz), [function call marked inline](https://godbolt.org/z/f1W6P87zT), [immediately invoked lambda](https://godbolt.org/z/G7cn1nevK)) confirm that lambdas can be inlined with the same gcc version/optimization settings as are used on TVM's CI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] junrushao commented on pull request #12607: [TIR] More hygenic TVM_SREF macros

Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #12607:
URL: https://github.com/apache/tvm/pull/12607#issuecomment-1227822499

   The only reason that I didn't do so previously was being a bit afraid that the lambda cannot be inlined...CC: @tqchen 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] junrushao commented on pull request #12607: [TIR] More hygenic TVM_SREF macros

Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #12607:
URL: https://github.com/apache/tvm/pull/12607#issuecomment-1227777061

   I think it's a perfect solution actually :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org