jdoerfert accepted this revision. jdoerfert added a comment. This revision is now accepted and ready to land.
In D81881#2095509 <https://reviews.llvm.org/D81881#2095509>, @ABataev wrote: > In D81881#2094062 <https://reviews.llvm.org/D81881#2094062>, @jdoerfert wrote: > > > So the idea is to do the trip count computation with defined overflow > > behavior, e.g., without `nsw/nuw` in IR, right? > > > Not quite. If we can predict that there is no overflow, everything remains > the same as before. If we cannot do this, the trip count calculations are > performed on unsigned types instead of signed. It does not just drop > `nuw/nsw` flags, but also uses `udiv`, `zext` etc. instead of `sdiv`, `sext` > etc. Plus, it tries to reorganize the operations a little bit to avoid > possible overflow. Makes sense. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81881/new/ https://reviews.llvm.org/D81881 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits