-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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 failure in TwoAddressInstructionPass #97533
Comments
@llvm/issue-subscribers-backend-x86 Author: Nikita Popov (nikic)
```llvm
; RUN: llc < %s
target triple = "x86_64-unknown-linux-gnu"
define ptr @test(ptr %ptr, i8 %arg, i1 %cond) { if: exit:
llc: /home/npopov/repos/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1461: bool (anonymous namespace)::TwoAddressInstructionPass::collectTiedOperands(MachineInstr *, TiedOperandMap &): Assertion `SrcReg && SrcMO.isUse() && "two address instruction invalid"' failed.
|
The instruction in question is:
|
I will take a look. |
It started fail since llc 18.1 https://www.godbolt.org/z/v5KPn3G61 |
Look like the branch doesn't matter: https://www.godbolt.org/z/hbrfc5TKs |
It seems related to the optimization about folding Here is a attempt
or
can make the test pass. |
Commenting out this code seems to fix it - I'm trying to work out why. llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Lines 5994 to 5998 in 687531f
EDIT Only works for the original test case - not the branchless reduction |
I have a workaround while I work on the underlying issue (we're deleting nodes that the DAG has already recorded in code selection) |
…(x),c)) if the pattern has multiple uses Fixes llvm#97533 crash where we hit a case where the root node had referenced the original zext node, which we then deleted - hopefully I can come up with a better solution, but the codegen changes don't look too bad atm (pulls out a shift from some complex LEA nodes that shared the scaled index). (cherry picked from commit e975ff0)
…(x),c)) if the pattern has multiple uses Fixes llvm#97533 crash where we hit a case where the root node had referenced the original zext node, which we then deleted - hopefully I can come up with a better solution, but the codegen changes don't look too bad atm (pulls out a shift from some complex LEA nodes that shared the scaled index). (cherry picked from commit e975ff0)
…(x),c)) if the pattern has multiple uses Fixes llvm#97533 crash where we hit a case where the root node had referenced the original zext node, which we then deleted - hopefully I can come up with a better solution, but the codegen changes don't look too bad atm (pulls out a shift from some complex LEA nodes that shared the scaled index).
Results in:
The text was updated successfully, but these errors were encountered: