@@ -1582,25 +1582,31 @@ static void printConstant(const Constant *COp, unsigned BitWidth,
1582
1582
bool IsFP = EltTy->isHalfTy () || EltTy->isFloatTy () || EltTy->isDoubleTy ();
1583
1583
unsigned EltBits = EltTy->getPrimitiveSizeInBits ();
1584
1584
unsigned E = std::min (BitWidth / EltBits, CDS->getNumElements ());
1585
- assert ((BitWidth % EltBits) == 0 && " Element size mismatch" );
1586
- for (unsigned I = 0 ; I != E; ++I) {
1587
- if (I != 0 )
1588
- CS << " ," ;
1589
- if (IsInteger)
1590
- printConstant (CDS->getElementAsAPInt (I), CS, PrintZero);
1591
- else if (IsFP)
1592
- printConstant (CDS->getElementAsAPFloat (I), CS, PrintZero);
1593
- else
1594
- CS << " ?" ;
1585
+ if ((BitWidth % EltBits) == 0 ) {
1586
+ for (unsigned I = 0 ; I != E; ++I) {
1587
+ if (I != 0 )
1588
+ CS << " ," ;
1589
+ if (IsInteger)
1590
+ printConstant (CDS->getElementAsAPInt (I), CS, PrintZero);
1591
+ else if (IsFP)
1592
+ printConstant (CDS->getElementAsAPFloat (I), CS, PrintZero);
1593
+ else
1594
+ CS << " ?" ;
1595
+ }
1596
+ } else {
1597
+ CS << " ?" ;
1595
1598
}
1596
1599
} else if (auto *CV = dyn_cast<ConstantVector>(COp)) {
1597
1600
unsigned EltBits = CV->getType ()->getScalarSizeInBits ();
1598
1601
unsigned E = std::min (BitWidth / EltBits, CV->getNumOperands ());
1599
- assert ((BitWidth % EltBits) == 0 && " Element size mismatch" );
1600
- for (unsigned I = 0 ; I != E; ++I) {
1601
- if (I != 0 )
1602
- CS << " ," ;
1603
- printConstant (CV->getOperand (I), EltBits, CS, PrintZero);
1602
+ if ((BitWidth % EltBits) == 0 ) {
1603
+ for (unsigned I = 0 ; I != E; ++I) {
1604
+ if (I != 0 )
1605
+ CS << " ," ;
1606
+ printConstant (CV->getOperand (I), EltBits, CS, PrintZero);
1607
+ }
1608
+ } else {
1609
+ CS << " ?" ;
1604
1610
}
1605
1611
} else {
1606
1612
CS << " ?" ;
0 commit comments