Skip to content

Missed optimization multiplication by const for cakeml #1162

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

Open
ordinarymath opened this issue Apr 26, 2025 · 4 comments
Open

Missed optimization multiplication by const for cakeml #1162

ordinarymath opened this issue Apr 26, 2025 · 4 comments

Comments

@ordinarymath
Copy link
Contributor

This issue is about optimizing the multiplication const in wordLang.
Note that pancake does this for known power of 2 [1] but it can be done smarter. see example llvm[2].

[1] https://github.com/CakeML/cakeml/blob/f37b65230f6b4665a5ac7b1730ef01bcf24115de/pancake/crep_arithScript.sml#L52C1-L59C4

[2] https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAMzwBtMA7AQwFtMQByARg9KtQYEAysib0QXACx8BBAKoBnTAAUAHpwAMvAFYTStJg1DIApACYAQuYukl9ZATwDKjdAGFUtAK4sGIM6SuADJ4DJgAcj4ARpjE/hqkAA6oCoRODB7evv5JKWkCIWGRLDFxZgl2mA7pQgRMxASZPn4BldUCtfUEhRHRsfG2dQ1N2a1D3aG9Jf3lAJS2qF7EyOwcAPRrANQAKgCeiZibu4vEm2hYmwixmKSbJJu0qEzom4abmKqsifQAdCYaAEFQgRNo42AoAMwQYGbBg%2BWabEwAdisgM26M2xEwBCWDFhPk2ACpNhCTBDUQDkQARf6UwG0mFgzAKSTQwT4lgI5EUjGY7G4jlEzaSMkU6m0hnspkKACsbJBcM5iJRtN5WJxxDxiqFMtFEqRNPpgMZeHBADZ5RyuSq0Rj1QLtcSzXr6QbJSDpVwzJbFdaeXb%2BZrBcSvS7KW7jVLTcyuFCYb7lf70fag47NrGw9SOPNaJwZbw/BwtKRUJw3NZrJsFCcVoizBCeKQCJps/MANYgCEQn5d3t9/tm/ScSQFlslzi8BQgBLNovZ0hwWBINAsRJ0WLkSgrtf0OL1FgANwAHABaZAGIwngjELwMNt8OgEWJTiBRMdRUL1XacRsf5jEXYAHkom0KpZ0bFc2EEQCGFob851ILAoi8YA3DEWgp24XgsBYQxgHEBD8CxaoD2ZMcPiqLwnx/XhgUwXMENoPAomIL8PCwMdr1NGjSFI4gohSTAqUwXCjCYowW3mKgDGABQADU8EwAB3QCDkLYt%2BEEEQxHYKQZEERQVHUBDdC4fQ8JQCtLH0Zip0geZUESRwBEwk9AIhXhUD44g8CwOyIHmNpnL8CBXBGPwzOCSZilKPRklSYLwrivJgp6GL%2BjMoKanGJLMvosDsq6NK%2BjiTKcs8Zo9AUcZiumUrAprXSczzUcENLDhXmIQ9TyYM4L2ATYIGvW82wRCBcEIe5zAbWZeFnLRZnbTtu37Vbe0HBiR1IdTPInWxpybSSFxgRAQGkphZM3CBt3XYgADEZNc9zeBu3dwlYVZVCPM0TzNSQ%2BrwwbhrvWbAnwIgfPQPRNOEURxD0mHDLUMdTKbLFMF86dmo4fNtrHdrhLqdcXg8Vdbs2B6LoUTrupPXrz0BoabxBwaJohusG1uUmd1iDmuFB%2BbW1IDsux7NbVqHDgtp28cOEnA7BcWyWzFa4t2rmyT5j41JnEkIA%3D%3D%3D

@ordinarymath
Copy link
Contributor Author

@tanyongkiam
Copy link
Contributor

Related to: #246

@ordinarymath
Copy link
Contributor Author

Isn't that issue about adding shifts for every pass from Source. wordlang already has shift instructions.

@tanyongkiam
Copy link
Contributor

No, it that issue should happen at closLang and below, including power reduction.

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

No branches or pull requests

2 participants