OSDN Git Service

Limit the recursion depth of SelectionDAG::isSplatValue()
authorJustin Bogner <mail@justinbogner.com>
Wed, 9 Dec 2020 18:33:59 +0000 (10:33 -0800)
committerJustin Bogner <mail@justinbogner.com>
Wed, 9 Dec 2020 18:35:07 +0000 (10:35 -0800)
commite6a1187dd867cc0feea4041b22a9bb29aaa3ae48
treeed64e2417d00441e704da3a76eb8e0b66d5139e9
parentbe9b4bbdfc226c6387304552bbc0312ed60bd602
Limit the recursion depth of SelectionDAG::isSplatValue()

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

Patch by Nicolas Capens. Thanks!

Differential Revision: https://reviews.llvm.org/D92421
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp