[PATCH] D109217: [NOT FOR COMMIT] [llvm-dwarfdump] Fix unsigned overflow when calculating stats

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 6 12:55:06 PDT 2021


dblaikie added a comment.

In D109217#2984816 <https://reviews.llvm.org/D109217#2984816>, @tschuett wrote:

> Could something ala:
> https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
> help?

Probably enough to write the portable code (so it works on MSVC too, etc) and let the compiler optimize it. At least for this saturation code, Clang produces the same with or without the intrinsic (& GCC produces something else entirely - to itself and to clang): https://godbolt.org/z/jb3nnaKvT


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109217/new/

https://reviews.llvm.org/D109217



More information about the llvm-commits mailing list