commit | 2e74d5dc03dfbfab0821f9aac5d2b3ad317eab28 | [log] [tgz] |
---|---|---|
author | Nicolas Capens <capn@google.com> | Sun Jan 16 23:18:52 2022 -0500 |
committer | Nicolas Capens <nicolascapens@google.com> | Tue Jan 18 21:04:33 2022 +0000 |
tree | 2f0004604e07faf7936338d9515580757726d74b | |
parent | 030b541b8e0038fd2c99b72ccb4fd74d7c51f363 [diff] |
Limit LLVM's getTargetShuffleInputs() recursion depth This prevents stack overflow in the dEQP-VK test mentioned below. The fix also landed upstream as part of https://github.com/llvm/llvm-project/issues/52960. Bug: b/207118262 Test: dEQP-VK.spirv_assembly.instruction.compute.opphi.wide Change-Id: I11ce36ed728b37b03f3a623f258177634b90da0e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/60148 Reviewed-by: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/third_party/llvm-10.0/llvm/lib/Target/X86/X86ISelLowering.cpp b/third_party/llvm-10.0/llvm/lib/Target/X86/X86ISelLowering.cpp index cbdd713..215898d 100644 --- a/third_party/llvm-10.0/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/third_party/llvm-10.0/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -7122,6 +7122,9 @@ SmallVectorImpl<SDValue> &Ops, SelectionDAG &DAG, unsigned Depth, bool ResolveKnownElts) { + if (Depth > SelectionDAG::MaxRecursionDepth) + return false; + Mask.clear(); Ops.clear();