[PATCH] D27044: Compilation crash after node replacement
Elena Demikhovsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 06:53:58 PST 2016
delena created this revision.
delena added reviewers: zvi, craig.topper, RKSimon, spatel.
delena added a subscriber: llvm-commits.
delena set the repository for this revision to rL LLVM.
The bug is here: https://llvm.org/bugs/show_bug.cgi?id=31045
The problem occurs when we take a node N and analyze its predecessors (operands of operands). We start from N and recursively go up N = N->getOperand(0).
On some stage of the climbing, we decide to replace one of predecessors with ReplaceAllUsesWith(N, NewNode). The ReplaceAllUsesWith works recursively and at some stage kills parent node.
I added ReplaceOneUseWith() to prevent recursive deletion.
Please let me know if this solution looks reasonable. (I attached the original reproducer, I'll minimize it if the solution itself makes sense.)
Repository:
rL LLVM
https://reviews.llvm.org/D27044
Files:
../include/llvm/CodeGen/SelectionDAG.h
../lib/CodeGen/SelectionDAG/SelectionDAG.cpp
../lib/Target/X86/X86ISelDAGToDAG.cpp
../test/CodeGen/X86/addr-calc-crash.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27044.79066.patch
Type: text/x-patch
Size: 9237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161123/a005ddef/attachment.bin>
More information about the llvm-commits
mailing list