Skip to content

Commit 513c783

Browse files
committed
Adopt suggestion from Craig
1 parent 797fb90 commit 513c783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ int getIntMatCost(const APInt &Val, unsigned Size, const MCSubtargetInfo &STI,
510510
int Cost = 0;
511511
for (unsigned ShiftVal = 0; ShiftVal < Size; ShiftVal += PlatRegSize) {
512512
APInt Chunk = Val.ashr(ShiftVal).sextOrTrunc(PlatRegSize);
513-
if (FreeZeroes && Chunk == 0)
513+
if (FreeZeroes && Chunk.getSExtValue() == 0)
514514
continue;
515515
InstSeq MatSeq = generateInstSeq(Chunk.getSExtValue(), STI);
516516
Cost += getInstSeqCost(MatSeq, HasRVC);

0 commit comments

Comments
 (0)