Fix for StackOverflow in SsaBuilder::TopologicalSort.
authorEugene Rozenfeld <erozen@microsoft.com>
Wed, 14 Sep 2016 19:41:47 +0000 (12:41 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Wed, 21 Sep 2016 17:30:30 +0000 (10:30 -0700)
commit79f0faf49be6b03061287bcc566b9f5726eae360
tree4bc5881c970fc1d69456be8f85241e1dd04eec48
parent21e4eb9cd224c6fa257c810d270e3ff45b12a63e
Fix for StackOverflow in SsaBuilder::TopologicalSort.

SsaBuilder::TopologicalSort allocated an array of bools on the stack.
In one of internal cases the array had 126,758 elements, which caused a
StackOverflow. This change switches SsaBuilder::TopologicalSort from
stack-allocated array of bools to BitVec.

TopologicalSortHelper used to be recursive. It was changed to use an iterative
algorithm in a previous change. I'm inlining TopologicalSortHelper into
TopologicalSort now.

I verified no measurable negative throughput impact from this change
and no asm diffs in SuperPMI.
src/jit/ssabuilder.cpp
tests/issues.targets
tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.csproj [new file with mode: 0644]
tests/x86_legacy_backend_issues.targets