Skip to content

Commit 4cf2ed4

Browse files
committed
[X86] Fix -Wsign-compare in X86MCInstLower.cpp (NFC)
llvm-project/llvm/lib/Target/X86/X86MCInstLower.cpp:1588:48: error: comparison of integers of different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare] if (C && C->getType()->getScalarSizeInBits() == SrcEltBits) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ 1 error generated.
1 parent d912f1f commit 4cf2ed4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/X86/X86MCInstLower.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ static void printBroadcast(const MachineInstr *MI, MCStreamer &OutStreamer,
15851585
static bool printSignExtend(const MachineInstr *MI, MCStreamer &OutStreamer,
15861586
int SrcEltBits, int DstEltBits) {
15871587
auto *C = X86::getConstantFromPool(*MI, 1);
1588-
if (C && C->getType()->getScalarSizeInBits() == SrcEltBits) {
1588+
if (C && C->getType()->getScalarSizeInBits() == unsigned(SrcEltBits)) {
15891589
if (auto *CDS = dyn_cast<ConstantDataSequential>(C)) {
15901590
int NumElts = CDS->getNumElements();
15911591
std::string Comment;

0 commit comments

Comments
 (0)