[PATCH] D46649: [AggressiveInstCombine] convert a chain of 'and-shift' bits into masked compare

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 10:36:54 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:75
+
+/// This is a recursive helper for foldAnyOrAllBitsSet() that walks through a
+/// chain of 'and' or 'or' instructions looking for shift ops of a common source
----------------
This looks, recursive.
I think this is a stack overflow waiting to happen.

Can you try to come up with some degenerative test-case
where it has to self-recurse 20-40 times,
just so we know it does not happen?



https://reviews.llvm.org/D46649





More information about the llvm-commits mailing list