OSDN Git Service

[PowerPC] Do not use vectors to codegen bswap with Altivec turned off
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 21 Nov 2018 02:53:50 +0000 (02:53 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 21 Nov 2018 02:53:50 +0000 (02:53 +0000)
commitecd20daf2c51b5f0e187e4ca996d805340b61cbe
treefd143243863955bafb8e049463664f7685e62cb3
parentc4acb066247ac5eade0a654d17b86939c0630a5f
[PowerPC] Do not use vectors to codegen bswap with Altivec turned off

We have efficient codegen on P9 for lowering bswap that involves moving
the value into a vector reg and moving it back. However, the check under
which we custom lowered it did not adequately reflect the actual requirements.
It required only that the subtarget be an implementation of ISA 3.0 since all
compliant implementations have to provide the vector instructions.
However, the kernel builds have a valid use case for -mno-altivec -mcpu=pwr9
(i.e. don't emit vector code, don't have to save vector regs for context
switch). So we should require the correct features for this lowering.
Fixes https://bugs.llvm.org/show_bug.cgi?id=39334

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347376 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/bswap64.ll