[llvm] r295575 - [X86][SSE] Avoid repeated calls to SDValue::getValueType.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 18 14:25:28 PST 2017
Author: rksimon
Date: Sat Feb 18 16:25:27 2017
New Revision: 295575
URL: http://llvm.org/viewvc/llvm-project?rev=295575&view=rev
Log:
[X86][SSE] Avoid repeated calls to SDValue::getValueType.
Added assertion to check input type of X86ISD::VZEXT during target known bits calculation.
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=295575&r1=295574&r2=295575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Feb 18 16:25:27 2017
@@ -26315,12 +26315,15 @@ void X86TargetLowering::computeKnownBits
case X86ISD::VZEXT: {
SDValue N0 = Op.getOperand(0);
unsigned NumElts = Op.getValueType().getVectorNumElements();
- unsigned InNumElts = N0.getValueType().getVectorNumElements();
- unsigned InBitWidth = N0.getValueType().getScalarSizeInBits();
+
+ EVT SrcVT = N0.getValueType();
+ unsigned InNumElts = SrcVT.getVectorNumElements();
+ unsigned InBitWidth = SrcVT.getScalarSizeInBits();
+ assert(InNumElts >= NumElts && "Illegal VZEXT input");
KnownZero = KnownOne = APInt(InBitWidth, 0);
- APInt DemandedElts = APInt::getLowBitsSet(InNumElts, NumElts);
- DAG.computeKnownBits(N0, KnownZero, KnownOne, DemandedElts, Depth + 1);
+ APInt DemandedSrcElts = APInt::getLowBitsSet(InNumElts, NumElts);
+ DAG.computeKnownBits(N0, KnownZero, KnownOne, DemandedSrcElts, Depth + 1);
KnownOne = KnownOne.zext(BitWidth);
KnownZero = KnownZero.zext(BitWidth);
KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - InBitWidth);
More information about the llvm-commits
mailing list