Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion `!(IsVariadic && IsIndirect)' failed: llvm::SDDbgValue::SDDbgValue(llvm::BumpPtrAllocator &, llvm::DIVariable *, llvm::DIExpression *, ArrayRef< llvm::SDDbgOperand>, ArrayRef<llvm::SDNode *>, bool, llvm::DebugLoc, unsigned int, bool) #72447

Closed
dcci opened this issue Nov 15, 2023 · 3 comments
Assignees
Labels
debuginfo llvm:SelectionDAG SelectionDAGISel as well

Comments

@dcci
Copy link
Member

dcci commented Nov 15, 2023

To repro:

./llc -O3 reduced.ll.txt

(file attached)
reduced.ll.txt

Points to:

commit 3ab03ad37d48d60596fc7f50f6c76794030baaf3
Author: David <david.stenberg@ericsson.com>
Date:   Wed Oct 25 12:51:49 2023 +0200

    [SelectionDAG] Salvage debug info for non-constant ADDs (#68981)
    
    Teach SelectionDAG::salvageDebugInfo() to salvage debug information for
    ADD nodes where the RHS is non-constant.
    
    Co-authored-by: Mikael Holmen <mikael.holmen@ericsson.com>
    
    - [DebugInfo] Precommit testcase for pointer addition with unknown
    offset
    - [SelectionDAG] Salvage debug info for non-constant ADDs
    
    ---------
    
    Co-authored-by: Mikael Holmen <mikael.holmen@ericsson.com>

 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp     | 43 ++++++++++++----
 .../pointer-add-unknown-offset-debug-info.mir      | 60 ++++++++++++++++++++++
 2 files changed, 93 insertions(+), 10 deletions(-)
@dcci
Copy link
Member Author

dcci commented Nov 15, 2023

@dstenb can you please help taking a look?

@EugeneZelenko EugeneZelenko added llvm:SelectionDAG SelectionDAGISel as well and removed new issue labels Nov 15, 2023
dstenb added a commit that referenced this issue Nov 18, 2023
…2645)

This is a follow-up to #68981, and fix for #72630, #72447.

We may end up in SelectionDAG::salvageDebugInfo() with indirect debug
values, and attempting to salvage ADD nodes with non-constant RHS would
lead us to try to turn those indirect debug values variadic, which is
not allowed.

This triggered the following assert in the SDDbgValue constructor:

  Assertion `!(IsVariadic && IsIndirect)' failed.

This also adds a lit test for salvaging when having an indirect debug
value and constant RHS, as there seems like there was no such lit test.
However, I am not sure if the use of the stack_value operation is
correct in that case (which is existing behavior before #68981), but
that at least documents the current behavior.
@dstenb
Copy link
Collaborator

dstenb commented Nov 18, 2023

Fixed by #72645.

@llvmbot
Copy link

llvmbot commented Nov 18, 2023

@llvm/issue-subscribers-debuginfo

Author: Davide Italiano (dcci)

To repro: ``` ./llc -O3 reduced.ll.txt ``` (file attached) [reduced.ll.txt](https://github.com/llvm/llvm-project/files/13370372/reduced.ll.txt)

Points to:

commit 3ab03ad37d48d60596fc7f50f6c76794030baaf3
Author: David &lt;david.stenberg@<!-- -->ericsson.com&gt;
Date:   Wed Oct 25 12:51:49 2023 +0200

    [SelectionDAG] Salvage debug info for non-constant ADDs (#<!-- -->68981)
    
    Teach SelectionDAG::salvageDebugInfo() to salvage debug information for
    ADD nodes where the RHS is non-constant.
    
    Co-authored-by: Mikael Holmen &lt;mikael.holmen@<!-- -->ericsson.com&gt;
    
    - [DebugInfo] Precommit testcase for pointer addition with unknown
    offset
    - [SelectionDAG] Salvage debug info for non-constant ADDs
    
    ---------
    
    Co-authored-by: Mikael Holmen &lt;mikael.holmen@<!-- -->ericsson.com&gt;

 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp     | 43 ++++++++++++----
 .../pointer-add-unknown-offset-debug-info.mir      | 60 ++++++++++++++++++++++
 2 files changed, 93 insertions(+), 10 deletions(-)

sr-tream pushed a commit to sr-tream/llvm-project that referenced this issue Nov 20, 2023
…vm#72645)

This is a follow-up to llvm#68981, and fix for llvm#72630, llvm#72447.

We may end up in SelectionDAG::salvageDebugInfo() with indirect debug
values, and attempting to salvage ADD nodes with non-constant RHS would
lead us to try to turn those indirect debug values variadic, which is
not allowed.

This triggered the following assert in the SDDbgValue constructor:

  Assertion `!(IsVariadic && IsIndirect)' failed.

This also adds a lit test for salvaging when having an indirect debug
value and constant RHS, as there seems like there was no such lit test.
However, I am not sure if the use of the stack_value operation is
correct in that case (which is existing behavior before llvm#68981), but
that at least documents the current behavior.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this issue Nov 20, 2023
…vm#72645)

This is a follow-up to llvm#68981, and fix for llvm#72630, llvm#72447.

We may end up in SelectionDAG::salvageDebugInfo() with indirect debug
values, and attempting to salvage ADD nodes with non-constant RHS would
lead us to try to turn those indirect debug values variadic, which is
not allowed.

This triggered the following assert in the SDDbgValue constructor:

  Assertion `!(IsVariadic && IsIndirect)' failed.

This also adds a lit test for salvaging when having an indirect debug
value and constant RHS, as there seems like there was no such lit test.
However, I am not sure if the use of the stack_value operation is
correct in that case (which is existing behavior before llvm#68981), but
that at least documents the current behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debuginfo llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

No branches or pull requests

4 participants