This is an archive of the discontinued LLVM Phabricator instance.

Limit the recursion depth of SelectionDAG::isSplatValue()
ClosedPublic

Authored by capn on Dec 1 2020, 12:37 PM.

Details

Summary

This method previously always recursively checked both the left-hand
side and right-hand side of binary operations for splatted (broadcast)
vector values to determine if the parent DAG node is a splat.

Like several other SelectionDAG methods, limit the recursion depth to
MaxRecursionDepth (6). This prevents stack overflow.
See also https://issuetracker.google.com/173785481

Diff Detail

Event Timeline

capn created this revision.Dec 1 2020, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2020, 12:37 PM
capn requested review of this revision.Dec 1 2020, 12:37 PM
capn updated this revision to Diff 308766.Dec 1 2020, 2:06 PM

Fix default argument

bogner accepted this revision.Dec 1 2020, 2:07 PM

LGTM once it actually compiles (we'll certainly need to call isSplatValue with a depth of zero somewhere)

This revision is now accepted and ready to land.Dec 1 2020, 2:07 PM
RKSimon accepted this revision.Dec 1 2020, 2:16 PM
RKSimon added a subscriber: RKSimon.

makes sense - thanks for dealing with this

capn added a comment.Dec 1 2020, 2:53 PM

Thanks for the quick review! I do not have commit access, please commit it for me.

capn added a comment.Dec 8 2020, 12:03 AM

Friendly ping. Can someone with commit privileges land this please?

Friendly ping. Can someone with commit privileges land this please?

Oh, sorry about that. I'll commit this for you today.

This revision was automatically updated to reflect the committed changes.