Limit the recursion depth of llvm::SelectionDAG::isSplatValue()
This method previously always recursively checked both the left-hand
side and right-hand side of binary operations for splatted (broadcast)
values to determine if the parent DAG node is a splat. For chained
operations, such as the 10,000 adds of the dEQP-VK.spirv_assembly.
instruction.graphics.spirv_ids_abuse.lots_ids_frag/vert tests,
very deep recursion could result in stack overflow.
Like several other SelectionDAG methods, limit the recursion depth to
MaxRecursionDepth (6).
Bug: b/173785481
Change-Id: I22ee0453db7cf1311267291a331ad8fa3b57b1d9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50672
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Jason Macnak <natsu@google.com>
Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
Tested-by:
Jason Macnak <natsu@google.com>
Showing
Please
register
or
sign in
to comment