The combine in rebuildSetCC may be combined to another
node leaving our references stale. Keep a handle on
it to avoid stale references.
Fixes PR36602.
Differential D46404
[DAG] Avoid using deleted node in rebuildSetCC niravd on May 3 2018, 12:35 PM. Authored by
Details The combine in rebuildSetCC may be combined to another Fixes PR36602.
Diff Detail
Event TimelineComment Actions This patch at least solves the problem with r325892 that I reported here: Thanks! Comment Actions This works for me too and looks good (but again, I don't know the framework very well). Thanks!
Comment Actions Add some explanatory text. Minor cleanup reducing number of handle construction/destructions. Comment Actions LGTM
|
This needs a much better comment explaining what we're doing, and why; normally the DAGCombine visitors are not supposed to call each other (because it causes weird issues like this).
And actually, I'm not sure why we're calling visitXOR here in the first place; if we're missing some important optimization on xors, we should probably fix the setcc optimizations to do the same thing rather than try to delay the xor->setcc transform. But I won't ask you to change that here; I don't want to delay the bugfix.