Skip to content

Commit c30fa3c

Browse files
authored
[AMDGPU] Fix has_single_bit assertion for Mask in SIInstrInfo (#109785)
Convert the `int64_t` Mask to `uint64_t` for `llvm::has_single_bit` to compile.
1 parent 497759e commit c30fa3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9793,7 +9793,7 @@ bool SIInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
97939793

97949794
// A valid Mask is required to have a single bit set, hence a non-zero and
97959795
// power-of-two value. This verifies that we will not do 64-bit shift below.
9796-
assert(llvm::has_single_bit(Mask) && "Invalid mask.");
9796+
assert(llvm::has_single_bit<uint64_t>(Mask) && "Invalid mask.");
97979797
unsigned BitNo = llvm::countr_zero((uint64_t)Mask);
97989798
if (IsSigned && BitNo == SrcSize - 1)
97999799
return false;

0 commit comments

Comments
 (0)