We were incorrectly inferring nsw for certain SCEVs. We can be more aggressive here (see Richard Smith's comment on http://llvm.org/bugs/show_bug.cgi?id=22179) but this change just focuses on correctness.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
1748–1749 ↗ | (On Diff #17968) | The extra parens don't really add to readability here and the expression is formatted a little funny, consider using clang-format here. |
1757–1758 ↗ | (On Diff #17968) | Why isn't this just equivalent to if (SignOrUnsignWrap == SCEV::FlagNSW) ? |
Comment Actions
LGTM with nits.
lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
1758 ↗ | (On Diff #17976) | std::bind1st and std::mem_fun are deprecated in C++11, we should probably avoid new references to them. How about: auto IsKnownNonNegative = std::bind(std::mem_fn(&ScalarEvolution::isKnownNonNegative), SE)); |
1761 ↗ | (On Diff #17976) | This looks way nicer :) |