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

Optimize BigInteger constant computation #3453

Open
MikaelMayer opened this issue Feb 3, 2023 · 1 comment
Open

Optimize BigInteger constant computation #3453

MikaelMayer opened this issue Feb 3, 2023 · 1 comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny lang: c# Dafny's C# transpiler and its runtime lang: java Dafny's Java transpiler and its runtime part: code-generation Support for transpiling Dafny to another language. If relevant, add a `lang:` tag

Comments

@MikaelMayer
Copy link
Member

Summary

function go(): nat {
  2 * 3 * 4
}

is compiled to a multiplication of big integers instead of in the result itself. There should be a flag to optimize constant folding so that there is only one big integer instead of a computation is has to do every time.

Background and Motivation

Every other compiler has optimization flags.

Proposed Feature

see above.

Alternatives

Writing the result is not practical.

@MikaelMayer MikaelMayer added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label part: code-generation Support for transpiling Dafny to another language. If relevant, add a `lang:` tag lang: java Dafny's Java transpiler and its runtime lang: c# Dafny's C# transpiler and its runtime and removed kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label labels Feb 3, 2023
@fabiomadge
Copy link
Collaborator

Why is this preferable to having the target language compiler take care of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny lang: c# Dafny's C# transpiler and its runtime lang: java Dafny's Java transpiler and its runtime part: code-generation Support for transpiling Dafny to another language. If relevant, add a `lang:` tag
Projects
None yet
Development

No branches or pull requests

2 participants