diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-06-25 20:52:59 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-06-25 20:52:59 +0000 |
commit | ab26227c8c9adce91a606a3691d4da08a9c8551c (patch) | |
tree | 701541c43568917524ac8ce65c7d11f29ac184d1 /lib/Target/X86/X86ISelLowering.cpp | |
parent | 041cde26eaf4ef6171ff1a44aeedd08d7a1cba6c (diff) |
- Fix a x86 vector isel bug: illegal transformation of a vector_shuffle into a
shift.
- Add a readme entry for a missing vector_shuffle optimization that results in
awful codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 16714427ba..bc7a4aec2b 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -2933,12 +2933,12 @@ unsigned getNumOfConsecutiveZeros(SDOperand Op, SDOperand Mask, SelectionDAG &DAG) { unsigned NumZeros = 0; for (unsigned i = 0; i < NumElems; ++i) { - SDOperand Idx = Mask.getOperand(Low ? i : NumElems-i-1); + unsigned Index = Low ? i : NumElems-i-1; + SDOperand Idx = Mask.getOperand(Index); if (Idx.getOpcode() == ISD::UNDEF) { ++NumZeros; continue; } - unsigned Index = cast<ConstantSDNode>(Idx)->getValue(); SDOperand Elt = DAG.getShuffleScalarElt(Op.Val, Index); if (Elt.Val && isZeroNode(Elt)) ++NumZeros; @@ -6373,8 +6373,7 @@ static bool EltsFromConsecutiveLoads(SDNode *N, SDOperand PermMask, continue; } - unsigned Index = cast<ConstantSDNode>(Idx)->getValue(); - SDOperand Elt = DAG.getShuffleScalarElt(N, Index); + SDOperand Elt = DAG.getShuffleScalarElt(N, i); if (!Elt.Val || (Elt.getOpcode() != ISD::UNDEF && !ISD::isNON_EXTLoad(Elt.Val))) return false; |