Skip to content

Commit 9ba438d

Browse files
committed
[RISCV] Remove some unnecessary casts from int64_t to uint64_t. NFC
We have a lot of casts near this to avoid undefined behavior or arithmetic on arbitrary signed integers, but the casts removed here don't appear to be necessary.
1 parent 00f5aaf commit 9ba438d

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
@@ -134,7 +134,7 @@ static void generateInstSeqImpl(int64_t Val, const MCSubtargetInfo &STI,
134134
}
135135

136136
// Try to use SLLI_UW for Val when it is uint32 but not int32.
137-
if (isUInt<32>((uint64_t)Val) && !isInt<32>((uint64_t)Val) &&
137+
if (isUInt<32>(Val) && !isInt<32>(Val) &&
138138
STI.hasFeature(RISCV::FeatureStdExtZba)) {
139139
// Use LUI+ADDI or LUI to compose, then clear the upper 32 bits with
140140
// SLLI_UW.

0 commit comments

Comments
 (0)