Commit 54cb405
[X86][ISel][FMA] Get a handle on operand nodes when negating FMA (llvm#130176)
When negating an FMA opcode, a new node created for a negated FMA
operand may be deleted while recursively negating another FMA operand.
This causes the following assertion to fail:
```
llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7686: llvm::SDValue llvm::SelectionDAG::getNode(unsigned int, const llvm::SDLoc&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags): Assertion `N1.getOpcode() != ISD::DELETED_NODE && N2.getOpcode() != ISD::DELETED_NODE && N3.getOpcode() != ISD::DELETED_NODE && "Operand is DELETED_NODE!"' failed.
```
This patch adds a temporary handle on the new negated nodes to prevent
them from being deleted.
For eg. see https://godbolt.org/z/Tq4PvnKM4 .
Co-authored-by: Vineet Kumar <[email protected]>1 parent b00ad36 commit 54cb405
File tree
2 files changed
+30
-0
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
2 files changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55694 | 55694 | | |
55695 | 55695 | | |
55696 | 55696 | | |
| 55697 | + | |
| 55698 | + | |
| 55699 | + | |
55697 | 55700 | | |
| 55701 | + | |
| 55702 | + | |
55698 | 55703 | | |
55699 | 55704 | | |
55700 | 55705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments