A mul by a negated power of 2 is a slli followed by neg. This doesn't
require any constant materialization and may be lower latency than mul.
The neg may also be foldable into other arithmetic.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
However, I'll note the code structure here is non-obvious. When I see code talking about immediate cost, I don't expect that to be highly specific to hoisting. I expect it to instead relate to materialization cost. And yet, that doesn't appear to be what the existing code in this method does.