Fix for segfault reported in PR 11990

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Dec 6 16:11:13 PST 2013


On 5 December 2013 15:40, Kaelyn Takata <rikka at google.com> wrote:
> I'm pretty sure it isn't because of the mutually recursive calls between
> between isSized and isSizedDerivedType.

OK,  sorry for taking so long. I spent most of the time trying to
figure out how to benchmark changes on this area once I noticed how
hot this path was.

In the end I went with

sudo schedtool -F  -a 0x4 -p 99 -e perf stat -r 5 ./bin/opt -O2
-disable-output -disable-verify gcc.bc

Where gcc.bc is from
http://people.csail.mit.edu/smcc/projects/single-file-programs/.

I used -disable-very since it is expected that the verifier would slow
down a bit, I just wanted to make sure the rest didn't.

Some observations:
* On code that passes the verifier with your patch we would not hit a
recursive type, so it is OK for non-verifier code to pass a NULL.
* Experimenting with always creating a set and passing it to an impl
function showed that it would be too expensive.
* Doing this only on the verifier would require duplicating the logic
or doing a second walk to find if the type is recursive.

So, in the end, LGTM :-)

Cheers,
Rafael



More information about the llvm-commits mailing list