llvm-project
7544b08a - [LiveDebugValues] Do not join debug values whose operand counts disagree (#221929)

Commit
5 days ago
[LiveDebugValues] Do not join debug values whose operand counts disagree (#221929) Currently, `DbgValueProperties::isJoinable()` decides whether two values could be joined by comparing their `DIExpressions` only. That was safe when location-operand count was taken from the expression. In instruction-referencing `LiveDebugValues`, `NumLocOps` is taken from the `MachineInstr` (`getNumDebugOperands()`), so two values can share an expression and still differ in operand count. Joining pairs location operands by index. When the counts disagreed, `pickVPHILoc` indexed past the shorter list and hit `assert(Index < OpCount)` in `DbgValue::getDbgOpID`. This change makes `isJoinable()` return `false` unless `NumLocOps` **also agrees**.
Parents
Loading