diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-20 22:51:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-20 22:51:43 +0000 |
commit | bd209ab9bc0f6ad667c15df4453955c2ed4c2434 (patch) | |
tree | 9160e248d446c46b977c690b65d0fd143473c8db /lib/CodeGen | |
parent | ea84e93a4275482f1545a8dd34526b07321ebf7f (diff) | |
download | external_llvm-bd209ab9bc0f6ad667c15df4453955c2ed4c2434.zip external_llvm-bd209ab9bc0f6ad667c15df4453955c2ed4c2434.tar.gz external_llvm-bd209ab9bc0f6ad667c15df4453955c2ed4c2434.tar.bz2 |
Simplify this code. getConstant knows how to make
broadcasted vector constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 33103cb..edd985e 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -839,16 +839,9 @@ SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, DebugLoc DL, MVT VT) { /// getNOT - Create a bitwise NOT operation as (XOR Val, -1). /// SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, MVT VT) { - SDValue NegOne; - if (VT.isVector()) { - MVT EltVT = VT.getVectorElementType(); - SDValue NegOneElt = - getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), EltVT); - std::vector<SDValue> NegOnes(VT.getVectorNumElements(), NegOneElt); - NegOne = getNode(ISD::BUILD_VECTOR, DL, VT, &NegOnes[0], NegOnes.size()); - } else { - NegOne = getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT); - } + MVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT; + SDValue NegOne = + getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT); return getNode(ISD::XOR, DL, VT, Val, NegOne); } |