[llvm] r188362 - Replace EVT with MVT in isVectorShift. Keeps compiler from generating unneeded checks and handling for extended types.

Craig Topper craig.topper at gmail.com
Tue Aug 13 23:21:10 PDT 2013


Author: ctopper
Date: Wed Aug 14 01:21:10 2013
New Revision: 188362

URL: http://llvm.org/viewvc/llvm-project?rev=188362&view=rev
Log:
Replace EVT with MVT in isVectorShift. Keeps compiler from generating unneeded checks and handling for extended types.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=188362&r1=188361&r2=188362&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Aug 14 01:21:10 2013
@@ -5076,7 +5076,8 @@ bool isShuffleMaskConsecutive(ShuffleVec
 /// logical left shift of a vector.
 static bool isVectorShiftRight(ShuffleVectorSDNode *SVOp, SelectionDAG &DAG,
                                bool &isLeft, SDValue &ShVal, unsigned &ShAmt) {
-  unsigned NumElems = SVOp->getValueType(0).getVectorNumElements();
+  unsigned NumElems =
+    SVOp->getValueType(0).getSimpleVT().getVectorNumElements();
   unsigned NumZeros = getNumOfConsecutiveZeros(
       SVOp, NumElems, false /* check zeros from right */, DAG,
       SVOp->getMaskElt(0));
@@ -5110,7 +5111,8 @@ static bool isVectorShiftRight(ShuffleVe
 /// logical left shift of a vector.
 static bool isVectorShiftLeft(ShuffleVectorSDNode *SVOp, SelectionDAG &DAG,
                               bool &isLeft, SDValue &ShVal, unsigned &ShAmt) {
-  unsigned NumElems = SVOp->getValueType(0).getVectorNumElements();
+  unsigned NumElems =
+    SVOp->getValueType(0).getSimpleVT().getVectorNumElements();
   unsigned NumZeros = getNumOfConsecutiveZeros(
       SVOp, NumElems, true /* check zeros from left */, DAG,
       NumElems - SVOp->getMaskElt(NumElems - 1) - 1);
@@ -5146,7 +5148,7 @@ static bool isVectorShift(ShuffleVectorS
                           bool &isLeft, SDValue &ShVal, unsigned &ShAmt) {
   // Although the logic below support any bitwidth size, there are no
   // shift instructions which handle more than 128-bit vectors.
-  if (!SVOp->getValueType(0).is128BitVector())
+  if (!SVOp->getValueType(0).getSimpleVT().is128BitVector())
     return false;
 
   if (isVectorShiftLeft(SVOp, DAG, isLeft, ShVal, ShAmt) ||





More information about the llvm-commits mailing list