]> granicus.if.org Git - llvm/commit
[SelectionDAG] Check for any recursion depth greater than or equal to limit instead...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 27 Jul 2019 12:48:46 +0000 (12:48 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 27 Jul 2019 12:48:46 +0000 (12:48 +0000)
commite1534e4ff48da6856f735edcca97a40bd793ab4f
tree2a2fb34108f7afd2f5fd9be9fb12b84f3afb5426
parent5972aca6bec62c139a364ad0b672f0005807125e
[SelectionDAG] Check for any recursion depth greater than or equal to limit instead of just equal the limit.

If anything called the recursive isKnownNeverNaN/computeKnownBits/ComputeNumSignBits/SimplifyDemandedBits/SimplifyMultipleUseDemandedBits with an incorrect depth then we could continue to recurse if we'd already exceeded the depth limit.

This replaces the limit check (Depth == 6) with a (Depth >= 6) to make sure that we don't circumvent it.

This causes a couple of regressions as a mixture of calls (SimplifyMultipleUseDemandedBits + combineX86ShufflesRecursively) were calling with depths that were already over the limit. I've fixed SimplifyMultipleUseDemandedBits to not do this. combineX86ShufflesRecursively is trickier as we get a lot of regressions if we reduce its own limit from 8 to 6 (it also starts at Depth == 1 instead of Depth == 0 like the others....) - I'll see what I can do in future patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367171 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/AArch64/bitfield-insert.ll
test/CodeGen/AMDGPU/idot8s.ll
test/CodeGen/AMDGPU/idot8u.ll
test/CodeGen/X86/vector-fshl-rot-512.ll
test/CodeGen/X86/vector-fshr-rot-512.ll
test/CodeGen/X86/vector-trunc-packus-widen.ll
test/CodeGen/X86/vector-trunc-packus.ll