[llvm] [llvm][DebugInfo] Emit 0/1 for constant boolean values (PR #151225)
Michael Buch via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 10 02:00:38 PDT 2025
================
@@ -733,6 +733,8 @@ MachineOperand GetMOForConstDbgOp(const SDDbgOperand &Op) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
if (CI->getBitWidth() > 64)
return MachineOperand::CreateCImm(CI);
+ if (CI->getBitWidth() == 1)
+ return MachineOperand::CreateImm(CI->getZExtValue());
----------------
Michael137 wrote:
This whole discussion started on a version of the patch where we tried to do this in debug-info. It wasn't clear which parts of debug-info emission should be responsible for this. And we don't want to fix-up legitimately corrupted booleans. We'd want this those cases to show up in the debugger. Instruction selection being the one to adjust it for debug ops seemed like the more appropriate place to do this at.
https://github.com/llvm/llvm-project/pull/151225
More information about the llvm-commits
mailing list