[llvm] [llvm][DebugInfo] Emit 0/1 for constant boolean values (PR #151225)

Laxman Sole via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 18:13:42 PDT 2025


================
@@ -109,8 +109,10 @@ MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C,
   if (auto *CI = dyn_cast<ConstantInt>(NumericConstant)) {
     if (CI->getBitWidth() > 64)
       MIB.addCImm(CI);
-    else
+    else if (CI->getBitWidth() == 1)
----------------
laxmansole wrote:

Immediate values need to be sign-extended for correctness. Consider a case where the immediate operand is a negative value.

https://github.com/llvm/llvm-project/pull/151225


More information about the llvm-commits mailing list