[llvm] d5c67bb - [RegAlloc] Cast uint8_t to unsigned before printing it.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 08:55:04 PDT 2021


Author: Craig Topper
Date: 2021-09-23T08:49:44-07:00
New Revision: d5c67bba62d3abc96ac501f45cabc33a100b00e8

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

LOG: [RegAlloc] Cast uint8_t to unsigned before printing it.

raw_ostream interprets uint8_t as wanting to print a character
with that ASCII value. In this case the uint8_t is an integer
that we want to print.

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegAllocGreedy.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 67fb8b4f8e5d..6646380ba211 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -858,7 +858,7 @@ MCRegister RAGreedy::tryAssign(LiveInterval &VirtReg,
     return PhysReg;
 
   LLVM_DEBUG(dbgs() << printReg(PhysReg, TRI) << " is available at cost "
-                    << Cost << '\n');
+                    << (unsigned)Cost << '\n');
   MCRegister CheapReg = tryEvict(VirtReg, Order, NewVRegs, Cost, FixedRegisters);
   return CheapReg ? CheapReg : PhysReg;
 }


        


More information about the llvm-commits mailing list