Skip to content

Commit 0167a92

Browse files
committed
[RISCV] Use unsigned instead of int64_t for two small positive shift amounts. NFC
1 parent e89f821 commit 0167a92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ bool RISCVDAGToDAGISel::tryIndexedLoad(SDNode *Node) {
693693

694694
// The constants that can be encoded in the THeadMemIdx instructions
695695
// are of the form (sign_extend(imm5) << imm2).
696-
int64_t Shift;
696+
unsigned Shift;
697697
for (Shift = 0; Shift < 4; Shift++)
698698
if (isInt<5>(Offset >> Shift) && ((Offset % (1LL << Shift)) == 0))
699699
break;
@@ -3366,7 +3366,7 @@ bool RISCVDAGToDAGISel::selectSimm5Shl2(SDValue N, SDValue &Simm5,
33663366
SDValue &Shl2) {
33673367
if (auto *C = dyn_cast<ConstantSDNode>(N)) {
33683368
int64_t Offset = C->getSExtValue();
3369-
int64_t Shift;
3369+
unsigned Shift;
33703370
for (Shift = 0; Shift < 4; Shift++)
33713371
if (isInt<5>(Offset >> Shift) && ((Offset % (1LL << Shift)) == 0))
33723372
break;

0 commit comments

Comments
 (0)