@@ -1399,23 +1399,6 @@ PrevCrossBBInst(MachineBasicBlock::const_iterator MBBI) {
1399
1399
return MBBI;
1400
1400
}
1401
1401
1402
- static const Constant *getConstantFromPool (const MachineInstr &MI,
1403
- const MachineOperand &Op) {
1404
- if (!Op.isCPI () || Op.getOffset () != 0 )
1405
- return nullptr ;
1406
-
1407
- ArrayRef<MachineConstantPoolEntry> Constants =
1408
- MI.getParent ()->getParent ()->getConstantPool ()->getConstants ();
1409
- const MachineConstantPoolEntry &ConstantEntry = Constants[Op.getIndex ()];
1410
-
1411
- // Bail if this is a machine constant pool entry, we won't be able to dig out
1412
- // anything useful.
1413
- if (ConstantEntry.isMachineConstantPoolEntry ())
1414
- return nullptr ;
1415
-
1416
- return ConstantEntry.Val .ConstVal ;
1417
- }
1418
-
1419
1402
static std::string getShuffleComment (const MachineInstr *MI, unsigned SrcOp1Idx,
1420
1403
unsigned SrcOp2Idx, ArrayRef<int > Mask) {
1421
1404
std::string Comment;
@@ -1674,7 +1657,7 @@ static void addConstantComments(const MachineInstr *MI,
1674
1657
" Unexpected number of operands!" );
1675
1658
1676
1659
const MachineOperand &MaskOp = MI->getOperand (MaskIdx);
1677
- if (auto *C = getConstantFromPool (*MI, MaskOp)) {
1660
+ if (auto *C = X86:: getConstantFromPool (*MI, MaskOp)) {
1678
1661
unsigned Width = getRegisterWidth (MI->getDesc ().operands ()[0 ]);
1679
1662
SmallVector<int , 64 > Mask;
1680
1663
DecodePSHUFBMask (C, Width, Mask);
@@ -1752,7 +1735,7 @@ static void addConstantComments(const MachineInstr *MI,
1752
1735
" Unexpected number of operands!" );
1753
1736
1754
1737
const MachineOperand &MaskOp = MI->getOperand (MaskIdx);
1755
- if (auto *C = getConstantFromPool (*MI, MaskOp)) {
1738
+ if (auto *C = X86:: getConstantFromPool (*MI, MaskOp)) {
1756
1739
unsigned Width = getRegisterWidth (MI->getDesc ().operands ()[0 ]);
1757
1740
SmallVector<int , 16 > Mask;
1758
1741
DecodeVPERMILPMask (C, ElSize, Width, Mask);
@@ -1781,7 +1764,7 @@ static void addConstantComments(const MachineInstr *MI,
1781
1764
}
1782
1765
1783
1766
const MachineOperand &MaskOp = MI->getOperand (3 + X86::AddrDisp);
1784
- if (auto *C = getConstantFromPool (*MI, MaskOp)) {
1767
+ if (auto *C = X86:: getConstantFromPool (*MI, MaskOp)) {
1785
1768
unsigned Width = getRegisterWidth (MI->getDesc ().operands ()[0 ]);
1786
1769
SmallVector<int , 16 > Mask;
1787
1770
DecodeVPERMIL2PMask (C, (unsigned )CtrlOp.getImm (), ElSize, Width, Mask);
@@ -1796,7 +1779,7 @@ static void addConstantComments(const MachineInstr *MI,
1796
1779
" Unexpected number of operands!" );
1797
1780
1798
1781
const MachineOperand &MaskOp = MI->getOperand (3 + X86::AddrDisp);
1799
- if (auto *C = getConstantFromPool (*MI, MaskOp)) {
1782
+ if (auto *C = X86:: getConstantFromPool (*MI, MaskOp)) {
1800
1783
unsigned Width = getRegisterWidth (MI->getDesc ().operands ()[0 ]);
1801
1784
SmallVector<int , 16 > Mask;
1802
1785
DecodeVPPERMMask (C, Width, Mask);
@@ -1809,7 +1792,8 @@ static void addConstantComments(const MachineInstr *MI,
1809
1792
case X86::MMX_MOVQ64rm: {
1810
1793
assert (MI->getNumOperands () == (1 + X86::AddrNumOperands) &&
1811
1794
" Unexpected number of operands!" );
1812
- if (auto *C = getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1795
+ if (auto *C =
1796
+ X86::getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1813
1797
std::string Comment;
1814
1798
raw_string_ostream CS (Comment);
1815
1799
const MachineOperand &DstOp = MI->getOperand (0 );
@@ -1881,7 +1865,8 @@ static void addConstantComments(const MachineInstr *MI,
1881
1865
case X86::VBROADCASTI64X4rm:
1882
1866
assert (MI->getNumOperands () >= (1 + X86::AddrNumOperands) &&
1883
1867
" Unexpected number of operands!" );
1884
- if (auto *C = getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1868
+ if (auto *C =
1869
+ X86::getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1885
1870
int NumLanes = 1 ;
1886
1871
int BitWidth = 128 ;
1887
1872
int CstEltSize = C->getType ()->getScalarSizeInBits ();
@@ -1984,7 +1969,8 @@ static void addConstantComments(const MachineInstr *MI,
1984
1969
case X86::VPBROADCASTWZrm:
1985
1970
assert (MI->getNumOperands () >= (1 + X86::AddrNumOperands) &&
1986
1971
" Unexpected number of operands!" );
1987
- if (auto *C = getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1972
+ if (auto *C =
1973
+ X86::getConstantFromPool (*MI, MI->getOperand (1 + X86::AddrDisp))) {
1988
1974
int NumElts, EltBits;
1989
1975
switch (MI->getOpcode ()) {
1990
1976
default : llvm_unreachable (" Invalid opcode" );
0 commit comments