HomePhabricator

[ValueTracking] Fix endless recursion in isKnownNonZero()

Description

[ValueTracking] Fix endless recursion in isKnownNonZero()

Summary:
The isKnownNonZero() function have checks that abort the recursion when
it reaches the specified max depth. However one of the recursive calls
was placed before the max depth check was done, resulting in a endless
recursion that eventually triggered a segmentation fault.

Fixed the problem by moving the max depth check above the first
recursive call.

Reviewers: Prazek, nlopes, spatel, craig.topper, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, bjope, llvm-commits

Differential Revision: https://reviews.llvm.org/D47531

Details

Committed
karkaMay 30 2018, 8:56 AM
Reviewer
hfinkel
Differential Revision
D47531: [ValueTracking] Fix endless recursion in isKnownNonZero()
Parents
rL333556: [AMDGPU][Waitcnt] Fix handling of loops with many bottom blocks
Branches
Unknown
Tags
Unknown