<div dir="ltr">Accidental commit. Reverted in r344875<div><br></div><div>~Craig<br><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 21, 2018 at 2:10 PM Craig Topper via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ctopper<br>
Date: Sun Oct 21 14:08:37 2018<br>
New Revision: 344875<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=344875&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=344875&view=rev</a><br>
Log:<br>
Revert r344873 "foo"<br>
<br>
Rebase gone wrong left this in my tree.<br>
<br>
Modified:<br>
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp<br>
llvm/trunk/lib/Target/X86/X86MCInstLower.cpp<br>
llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp<br>
llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=344875&r1=344874&r2=344875&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=344875&r1=344874&r2=344875&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Oct 21 14:08:37 2018<br>
@@ -6046,7 +6046,7 @@ static bool getTargetShuffleMask(SDNode<br>
break;<br>
}<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodeVPERMILPMask(C, MaskEltSize, VT.getSizeInBits(), Mask);<br>
+ DecodeVPERMILPMask(C, MaskEltSize, Mask);<br>
break;<br>
}<br>
return false;<br>
@@ -6063,7 +6063,7 @@ static bool getTargetShuffleMask(SDNode<br>
break;<br>
}<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodePSHUFBMask(C, VT.getSizeInBits(), Mask);<br>
+ DecodePSHUFBMask(C, Mask);<br>
break;<br>
}<br>
return false;<br>
@@ -6128,7 +6128,7 @@ static bool getTargetShuffleMask(SDNode<br>
break;<br>
}<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodeVPERMIL2PMask(C, CtrlImm, MaskEltSize, VT.getSizeInBits(), Mask);<br>
+ DecodeVPERMIL2PMask(C, CtrlImm, MaskEltSize, Mask);<br>
break;<br>
}<br>
}<br>
@@ -6145,7 +6145,7 @@ static bool getTargetShuffleMask(SDNode<br>
break;<br>
}<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodeVPPERMMask(C, VT.getSizeInBits(), Mask);<br>
+ DecodeVPPERMMask(C, Mask);<br>
break;<br>
}<br>
return false;<br>
@@ -6163,7 +6163,7 @@ static bool getTargetShuffleMask(SDNode<br>
break;<br>
}<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodeVPERMVMask(C, MaskEltSize, VT.getSizeInBits(), Mask);<br>
+ DecodeVPERMVMask(C, MaskEltSize, Mask);<br>
break;<br>
}<br>
return false;<br>
@@ -6178,7 +6178,7 @@ static bool getTargetShuffleMask(SDNode<br>
SDValue MaskNode = N->getOperand(1);<br>
unsigned MaskEltSize = VT.getScalarSizeInBits();<br>
if (auto *C = getTargetConstantFromNode(MaskNode)) {<br>
- DecodeVPERMV3Mask(C, MaskEltSize, VT.getSizeInBits(), Mask);<br>
+ DecodeVPERMV3Mask(C, MaskEltSize, Mask);<br>
break;<br>
}<br>
return false;<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=344875&r1=344874&r2=344875&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=344875&r1=344874&r2=344875&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Sun Oct 21 14:08:37 2018<br>
@@ -1594,18 +1594,6 @@ void X86AsmPrinter::EmitSEHInstruction(c<br>
}<br>
}<br>
<br>
-static unsigned getRegisterWidth(const MCOperandInfo &Info) {<br>
- if (Info.RegClass == X86::VR128RegClassID ||<br>
- Info.RegClass == X86::VR128XRegClassID)<br>
- return 128;<br>
- if (Info.RegClass == X86::VR256RegClassID ||<br>
- Info.RegClass == X86::VR256XRegClassID)<br>
- return 256;<br>
- if (Info.RegClass == X86::VR512RegClassID)<br>
- return 512;<br>
- llvm_unreachable("Unknown register class!");<br>
-}<br>
-<br>
void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {<br>
X86MCInstLower MCInstLowering(*MF, *this);<br>
const X86RegisterInfo *RI =<br>
@@ -1891,9 +1879,8 @@ void X86AsmPrinter::EmitInstruction(cons<br>
<br>
const MachineOperand &MaskOp = MI->getOperand(MaskIdx);<br>
if (auto *C = getConstantFromPool(*MI, MaskOp)) {<br>
- unsigned Width = getRegisterWidth(MI->getDesc().OpInfo[0]);<br>
SmallVector<int, 64> Mask;<br>
- DecodePSHUFBMask(C, Width, Mask);<br>
+ DecodePSHUFBMask(C, Mask);<br>
if (!Mask.empty())<br>
OutStreamer->AddComment(getShuffleComment(MI, SrcIdx, SrcIdx, Mask),<br>
!EnablePrintSchedInfo);<br>
@@ -1964,9 +1951,8 @@ void X86AsmPrinter::EmitInstruction(cons<br>
<br>
const MachineOperand &MaskOp = MI->getOperand(MaskIdx);<br>
if (auto *C = getConstantFromPool(*MI, MaskOp)) {<br>
- unsigned Width = getRegisterWidth(MI->getDesc().OpInfo[0]);<br>
SmallVector<int, 16> Mask;<br>
- DecodeVPERMILPMask(C, ElSize, Width, Mask);<br>
+ DecodeVPERMILPMask(C, ElSize, Mask);<br>
if (!Mask.empty())<br>
OutStreamer->AddComment(getShuffleComment(MI, SrcIdx, SrcIdx, Mask),<br>
!EnablePrintSchedInfo);<br>
@@ -1996,9 +1982,8 @@ void X86AsmPrinter::EmitInstruction(cons<br>
<br>
const MachineOperand &MaskOp = MI->getOperand(6);<br>
if (auto *C = getConstantFromPool(*MI, MaskOp)) {<br>
- unsigned Width = getRegisterWidth(MI->getDesc().OpInfo[0]);<br>
SmallVector<int, 16> Mask;<br>
- DecodeVPERMIL2PMask(C, (unsigned)CtrlOp.getImm(), ElSize, Width, Mask);<br>
+ DecodeVPERMIL2PMask(C, (unsigned)CtrlOp.getImm(), ElSize, Mask);<br>
if (!Mask.empty())<br>
OutStreamer->AddComment(getShuffleComment(MI, 1, 2, Mask),<br>
!EnablePrintSchedInfo);<br>
@@ -2014,9 +1999,8 @@ void X86AsmPrinter::EmitInstruction(cons<br>
<br>
const MachineOperand &MaskOp = MI->getOperand(6);<br>
if (auto *C = getConstantFromPool(*MI, MaskOp)) {<br>
- unsigned Width = getRegisterWidth(MI->getDesc().OpInfo[0]);<br>
SmallVector<int, 16> Mask;<br>
- DecodeVPPERMMask(C, Width, Mask);<br>
+ DecodeVPPERMMask(C, Mask);<br>
if (!Mask.empty())<br>
OutStreamer->AddComment(getShuffleComment(MI, 1, 2, Mask),<br>
!EnablePrintSchedInfo);<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp?rev=344875&r1=344874&r2=344875&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp?rev=344875&r1=344874&r2=344875&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp Sun Oct 21 14:08:37 2018<br>
@@ -112,10 +112,11 @@ static bool extractConstantMask(const Co<br>
return true;<br>
}<br>
<br>
-void DecodePSHUFBMask(const Constant *C, unsigned Width,<br>
- SmallVectorImpl<int> &ShuffleMask) {<br>
- assert((Width == 128 || Width == 256 || Width == 512) &&<br>
- C->getType()->getPrimitiveSizeInBits() >= Width &&<br>
+void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {<br>
+ Type *MaskTy = C->getType();<br>
+ unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
+ (void)MaskTySize;<br>
+ assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&<br>
"Unexpected vector size.");<br>
<br>
// The shuffle mask requires a byte vector.<br>
@@ -124,7 +125,7 @@ void DecodePSHUFBMask(const Constant *C,<br>
if (!extractConstantMask(C, 8, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / 8;<br>
+ unsigned NumElts = RawMask.size();<br>
assert((NumElts == 16 || NumElts == 32 || NumElts == 64) &&<br>
"Unexpected number of vector elements.");<br>
<br>
@@ -150,10 +151,12 @@ void DecodePSHUFBMask(const Constant *C,<br>
}<br>
}<br>
<br>
-void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMILPMask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask) {<br>
- assert((Width == 128 || Width == 256 || Width == 512) &&<br>
- C->getType()->getPrimitiveSizeInBits() >= Width &&<br>
+ Type *MaskTy = C->getType();<br>
+ unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
+ (void)MaskTySize;<br>
+ assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&<br>
"Unexpected vector size.");<br>
assert((ElSize == 32 || ElSize == 64) && "Unexpected vector element size.");<br>
<br>
@@ -163,7 +166,7 @@ void DecodeVPERMILPMask(const Constant *<br>
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / ElSize;<br>
+ unsigned NumElts = RawMask.size();<br>
unsigned NumEltsPerLane = 128 / ElSize;<br>
assert((NumElts == 2 || NumElts == 4 || NumElts == 8 || NumElts == 16) &&<br>
"Unexpected number of vector elements.");<br>
@@ -186,13 +189,11 @@ void DecodeVPERMILPMask(const Constant *<br>
}<br>
<br>
void DecodeVPERMIL2PMask(const Constant *C, unsigned M2Z, unsigned ElSize,<br>
- unsigned Width,<br>
SmallVectorImpl<int> &ShuffleMask) {<br>
Type *MaskTy = C->getType();<br>
unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
(void)MaskTySize;<br>
- assert((MaskTySize == 128 || MaskTySize == 256) &&<br>
- Width >= MaskTySize && "Unexpected vector size.");<br>
+ assert((MaskTySize == 128 || MaskTySize == 256) && "Unexpected vector size.");<br>
<br>
// The shuffle mask requires elements the same size as the target.<br>
APInt UndefElts;<br>
@@ -200,7 +201,7 @@ void DecodeVPERMIL2PMask(const Constant<br>
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / ElSize;<br>
+ unsigned NumElts = RawMask.size();<br>
unsigned NumEltsPerLane = 128 / ElSize;<br>
assert((NumElts == 2 || NumElts == 4 || NumElts == 8) &&<br>
"Unexpected number of vector elements.");<br>
@@ -241,12 +242,9 @@ void DecodeVPERMIL2PMask(const Constant<br>
}<br>
}<br>
<br>
-void DecodeVPPERMMask(const Constant *C, unsigned Width,<br>
- SmallVectorImpl<int> &ShuffleMask) {<br>
- Type *MaskTy = C->getType();<br>
- unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
- (void)MaskTySize;<br>
- assert(Width == 128 && Width >= MaskTySize && "Unexpected vector size.");<br>
+void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask) {<br>
+ assert(C->getType()->getPrimitiveSizeInBits() == 128 &&<br>
+ "Unexpected vector size.");<br>
<br>
// The shuffle mask requires a byte vector.<br>
APInt UndefElts;<br>
@@ -254,7 +252,7 @@ void DecodeVPPERMMask(const Constant *C,<br>
if (!extractConstantMask(C, 8, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / 8;<br>
+ unsigned NumElts = RawMask.size();<br>
assert(NumElts == 16 && "Unexpected number of vector elements.");<br>
<br>
for (unsigned i = 0; i != NumElts; ++i) {<br>
@@ -293,10 +291,12 @@ void DecodeVPPERMMask(const Constant *C,<br>
}<br>
}<br>
<br>
-void DecodeVPERMVMask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMVMask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask) {<br>
- assert((Width == 128 || Width == 256 || Width == 512) &&<br>
- C->getType()->getPrimitiveSizeInBits() >= Width &&<br>
+ Type *MaskTy = C->getType();<br>
+ unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
+ (void)MaskTySize;<br>
+ assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&<br>
"Unexpected vector size.");<br>
assert((ElSize == 8 || ElSize == 16 || ElSize == 32 || ElSize == 64) &&<br>
"Unexpected vector element size.");<br>
@@ -307,7 +307,7 @@ void DecodeVPERMVMask(const Constant *C,<br>
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / ElSize;<br>
+ unsigned NumElts = RawMask.size();<br>
<br>
for (unsigned i = 0; i != NumElts; ++i) {<br>
if (UndefElts[i]) {<br>
@@ -319,10 +319,12 @@ void DecodeVPERMVMask(const Constant *C,<br>
}<br>
}<br>
<br>
-void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask) {<br>
- assert((Width == 128 || Width == 256 || Width == 512) &&<br>
- C->getType()->getPrimitiveSizeInBits() >= Width &&<br>
+ Type *MaskTy = C->getType();<br>
+ unsigned MaskTySize = MaskTy->getPrimitiveSizeInBits();<br>
+ (void)MaskTySize;<br>
+ assert((MaskTySize == 128 || MaskTySize == 256 || MaskTySize == 512) &&<br>
"Unexpected vector size.");<br>
assert((ElSize == 8 || ElSize == 16 || ElSize == 32 || ElSize == 64) &&<br>
"Unexpected vector element size.");<br>
@@ -333,7 +335,7 @@ void DecodeVPERMV3Mask(const Constant *C<br>
if (!extractConstantMask(C, ElSize, UndefElts, RawMask))<br>
return;<br>
<br>
- unsigned NumElts = Width / ElSize;<br>
+ unsigned NumElts = RawMask.size();<br>
<br>
for (unsigned i = 0; i != NumElts; ++i) {<br>
if (UndefElts[i]) {<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h?rev=344875&r1=344874&r2=344875&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h?rev=344875&r1=344874&r2=344875&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h (original)<br>
+++ llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.h Sun Oct 21 14:08:37 2018<br>
@@ -26,28 +26,25 @@ class Constant;<br>
class MVT;<br>
<br>
/// Decode a PSHUFB mask from an IR-level vector constant.<br>
-void DecodePSHUFBMask(const Constant *C, unsigned Width,<br>
- SmallVectorImpl<int> &ShuffleMask);<br>
+void DecodePSHUFBMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask);<br>
<br>
/// Decode a VPERMILP variable mask from an IR-level vector constant.<br>
-void DecodeVPERMILPMask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMILPMask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask);<br>
<br>
/// Decode a VPERMILP2 variable mask from an IR-level vector constant.<br>
void DecodeVPERMIL2PMask(const Constant *C, unsigned MatchImm, unsigned ElSize,<br>
- unsigned Width,<br>
SmallVectorImpl<int> &ShuffleMask);<br>
<br>
/// Decode a VPPERM variable mask from an IR-level vector constant.<br>
-void DecodeVPPERMMask(const Constant *C, unsigned Width,<br>
- SmallVectorImpl<int> &ShuffleMask);<br>
+void DecodeVPPERMMask(const Constant *C, SmallVectorImpl<int> &ShuffleMask);<br>
<br>
/// Decode a VPERM W/D/Q/PS/PD mask from an IR-level vector constant.<br>
-void DecodeVPERMVMask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMVMask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask);<br>
<br>
/// Decode a VPERMT2 W/D/Q/PS/PD mask from an IR-level vector constant.<br>
-void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize, unsigned Width,<br>
+void DecodeVPERMV3Mask(const Constant *C, unsigned ElSize,<br>
SmallVectorImpl<int> &ShuffleMask);<br>
<br>
} // llvm namespace<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>