Fix __builtin_bitreverse32 on 32-bit PowerPC
authorgkoehler <gkoehler@openbsd.org>
Wed, 21 Apr 2021 00:22:16 +0000 (00:22 +0000)
committergkoehler <gkoehler@openbsd.org>
Wed, 21 Apr 2021 00:22:16 +0000 (00:22 +0000)
commitad7a5093f00b06fcfb3a0eba1e1f2a990e8cc7a8
treec3f55aa15e50802cafe90b99386ccadf36d2303a
parentc5fa57f5fbfbc33fa4adf7b5fe3c690a2e0d2e27
Fix __builtin_bitreverse32 on 32-bit PowerPC

This is a backport from LLVM 11.  Before this fix, code using
__builtin_bitreverse32 was crashing SIGILL because clang-10 emitted a
64-bit rldicl/clrldi instruction.  The SIGILL only happened on 32-bit
cpus, not on the G5.  The code for LLVM 11 uses __builtin_bitreverse,
so clang-10 needs this fix to build clang-11.

https://github.com/llvm/llvm-project/commit/a5d161c119d5a
https://reviews.llvm.org/D77946

ok kettenis@
gnu/llvm/llvm/lib/Target/PowerPC/PPCInstrInfo.td