ARROW-15461: [C++] Avoid clang bug in ReverseBitmap
ARROW-15461: [C++] Avoid clang bug in ReverseBitmap

Clang 12 would generate buggy code for the `GetReversedBlock` utility function.
(see report in https://github.com/llvm/llvm-project/issues/53421)

Rewrite it in a more optimized way, also circumventing the code generation bug.

Closes #12276 from pitrou/ARROW-15461-clang-reverse-bitmap

Authored-by: Antoine Pitrou <9359a4d812173b65a3a0094cd86363e79731a3c2@python.org>
Signed-off-by: Yibo Cai <e732a3f0de35687e82bda0008a72e443d2f69704@arm.com>

laurentgo/arrow,apache/arrow,wesm/arrow,laurentgo/arrow,apache/arrow,laurentgo/arrow,wesm/arrow,apache/arrow,laurentgo/arrow,kou/arrow,kou/arrow,wesm/arrow,apache/arrow,wesm/arrow,laurentgo/arrow,wesm/arrow,apache/arrow,kou/arrow,laurentgo/arrow,apache/arrow,kou/arrow,icexelloss/arrow,wesm/arrow,laurentgo/arrow,icexelloss/arrow,apache/arrow,kou/arrow,wesm/arrow,icexelloss/arrow,wesm/arrow,icexelloss/arrow,laurentgo/arrow,kou/arrow,apache/arrow,icexelloss/arrow,wesm/arrow,wesm/arrow,laurentgo/arrow,apache/arrow,kou/arrow,icexelloss/arrow,icexelloss/arrow,laurentgo/arrow,kou/arrow,apache/arrow,laurentgo/arrow,kou/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,icexelloss/arrow,kou/arrow,icexelloss/arrow,kou/arrow,apache/arrow,laurentgo/arrow,wesm/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,icexelloss/arrow,apache/arrow,kou/arrow,icexelloss/arrow,laurentgo/arrow,laurentgo/arrow,icexelloss/arrow,kou/arrow,kou/arrow,wesm/arrow,laurentgo/arrow