This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Fix endless recursion in isKnownNonZero()
ClosedPublic

Authored by Ka-Ka on May 30 2018, 6:10 AM.

Details

Summary

The isKnownNonZero() function have checks that abort the recursion when
it reach 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.

Diff Detail

Repository
rL LLVM

Event Timeline

Ka-Ka created this revision.May 30 2018, 6:10 AM
bjope added a subscriber: bjope.May 30 2018, 6:55 AM
bjope added inline comments.
test/Transforms/CorrelatedValuePropagation/pointer.ll
2 ↗(On Diff #149103)

Remove the -mtriple if possible.
If the -mtriple is needed, then the test should to go into a target specific subdir with a lit.local.cfg.

Ka-Ka updated this revision to Diff 149114.May 30 2018, 7:08 AM
Ka-Ka marked an inline comment as done.

Updated testcase according to comment.

hfinkel accepted this revision.May 30 2018, 8:11 AM
hfinkel added a subscriber: hfinkel.

LGTM

This revision is now accepted and ready to land.May 30 2018, 8:11 AM
This revision was automatically updated to reflect the committed changes.