A small optimization suggested by jakehehrlich@ in D64790.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Support/Alignment.h | ||
---|---|---|
174 | IIUC, -value is just the same as ~(value - 1). but only works if the representation two's complement. C++ does not guarantee two's complement. What about using ~(value - 1) instead ? |
IIUC, -value is just the same as ~(value - 1). but only works if the representation two's complement. C++ does not guarantee two's complement. What about using ~(value - 1) instead ?
https://godbolt.org/z/8KJBV3