[llvm] 629aebc - [CodeGen] Use llvm::has_single_bit (NFC) (#143394)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 12:46:18 PDT 2025


Author: Kazu Hirata
Date: 2025-06-09T12:46:15-07:00
New Revision: 629aebcd1747fc9523ec838057e7c08bef52bef3

URL: https://github.com/llvm/llvm-project/commit/629aebcd1747fc9523ec838057e7c08bef52bef3
DIFF: https://github.com/llvm/llvm-project/commit/629aebcd1747fc9523ec838057e7c08bef52bef3.diff

LOG: [CodeGen] Use llvm::has_single_bit (NFC) (#143394)

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
index a70acca98a5c4..727cd9abf9272 100644
--- a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
@@ -59,7 +59,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
 
     InstrStage::FuncUnits& operator[](size_t idx) const {
       // Depth is expected to be a power-of-2.
-      assert(Depth && !(Depth & (Depth - 1)) &&
+      assert(llvm::has_single_bit(Depth) &&
              "Scoreboard was not initialized properly!");
 
       return Data[(Head + idx) & (Depth-1)];


        


More information about the llvm-commits mailing list