ghc produces poor code for `div` with constant powers of 2.
The code for Int (div x c)
where c
is a constant of the form 2^n^ should be implemented with an arithmetic right shift, currently it's a call to a function. This optimization should be done for all signed types.
Trac metadata
Trac field | Value |
---|---|
Version | 7.2.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |