This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Don't crash if getAnalysisResultForFunction() returns null LoopInfo
ClosedPublic

Authored by durin42 on Jul 12 2022, 1:15 PM.

Details

Summary

I have no idea what's going on here. This code was moved
around/introduced in change cb26b01d57f5 and starts crashing with a NULL
dereference once I apply https://reviews.llvm.org/D123090. I assume that
I've unwittingly taught the attributor enough that it's able to do more
clever things than in the past, and it's able to trip on this case. I
make no claims about the correctness of this patch, but it passes tests
and seems to fix all the crashes I've been seeing.

Diff Detail

Event Timeline

durin42 created this revision.Jul 12 2022, 1:15 PM
Herald added a project: Restricted Project. · View Herald Transcript
durin42 requested review of this revision.Jul 12 2022, 1:15 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert accepted this revision.Jul 12 2022, 1:37 PM

LG with return true.

llvm/lib/Transforms/IPO/AttributorAttributes.cpp
6406

return true is the conservative answer here.

This revision is now accepted and ready to land.Jul 12 2022, 1:37 PM
This revision was landed with ongoing or failed builds.Jul 12 2022, 1:44 PM
This revision was automatically updated to reflect the committed changes.