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

[Lang] Demote pow() with integer exponent #6044

Merged
merged 5 commits into from
Sep 13, 2022

Conversation

strongoier
Copy link
Contributor

Related issue = #5915

Just as proposed in #5915, we specially handle pow() with an integer exponent by demoting it with manual fast-pow implementation in the demote_operations pass so that pow() can have the same behavior across backends. In this case the return type is the type of base (lhs).

@netlify
Copy link

netlify bot commented Sep 13, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit e46da36
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/631ff35091f8f20009189f81
😎 Deploy Preview https://deploy-preview-6044--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

Nice work!

taichi/ir/frontend_ir.cpp Show resolved Hide resolved
@strongoier strongoier merged commit 58d177f into taichi-dev:master Sep 13, 2022
@strongoier strongoier deleted the fix-5915 branch September 13, 2022 07:27
strongoier added a commit that referenced this pull request Sep 13, 2022
Related issue = #5915

This PR resolves
#6044 (comment).

<!--
Thank you for your contribution!

If it is your first time contributing to Taichi, please read our
Contributor Guidelines:
  https://docs.taichi-lang.org/docs/contributor_guide

- Please always prepend your PR title with tags such as [CUDA], [Lang],
[Doc], [Example]. For a complete list of valid PR tags, please check out
https://github.com/taichi-dev/taichi/blob/master/misc/prtags.json.
- Use upper-case tags (e.g., [Metal]) for PRs that change public APIs.
Otherwise, please use lower-case tags (e.g., [metal]).
- More details:
https://docs.taichi-lang.org/docs/contributor_guide#pr-title-format-and-tags

- Please fill in the issue number that this PR relates to.
- If your PR fixes the issue **completely**, use the `close` or `fixes`
prefix so that GitHub automatically closes the issue when the PR is
merged. For example,
    Related issue = close #2345
- If the PR does not belong to any existing issue, free to leave it
blank.
-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
ailzhang pushed a commit that referenced this pull request Sep 14, 2022
Related issue = #5915

As `pow()` with integer exponent is already demoted (#6044), there's no
need for backends to handle integer pows.
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.

2 participants