Skip to content

[AMDGPU] Fix has_single_bit assertion for Mask in SIInstrInfo #109785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

GeorgeWeb
Copy link
Contributor

Convert the int64_t Mask to uint64_t for llvm::has_single_bit to compile.

Convert the int64_t Mask to uint64_t for llvm::has_single_bit to compile.
@llvmbot
Copy link
Member

llvmbot commented Sep 24, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Georgi Mirazchiyski (GeorgeWeb)

Changes

Convert the int64_t Mask to uint64_t for llvm::has_single_bit to compile.


Full diff: https://github.com/llvm/llvm-project/pull/109785.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIInstrInfo.cpp (+1-1)
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index f5f367b2a4a7c6..9ad0b4c65e1d90 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -9793,7 +9793,7 @@ bool SIInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
 
     // A valid Mask is required to have a single bit set, hence a non-zero and
     // power-of-two value. This verifies that we will not do 64-bit shift below.
-    assert(llvm::has_single_bit(Mask) && "Invalid mask.");
+    assert(llvm::has_single_bit<uint64_t>(Mask) && "Invalid mask.");
     unsigned BitNo = llvm::countr_zero((uint64_t)Mask);
     if (IsSigned && BitNo == SrcSize - 1)
       return false;

@GeorgeWeb
Copy link
Contributor Author

GeorgeWeb commented Sep 24, 2024

Fixes build failures caused from 6cfe6a6. (see #108416 (comment))

@arsenm arsenm merged commit c30fa3c into llvm:main Sep 24, 2024
7 of 10 checks passed
@jplehr
Copy link
Contributor

jplehr commented Sep 24, 2024

Thanks for fix! (at least for our bots)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants