[llvm] [IR] Specify that overflow is poison, not UB in {s,u}{mul,div}.fix (PR #141748)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 05:48:11 PDT 2025
================
@@ -18819,8 +18819,8 @@ If the result value cannot be precisely represented in the given scale, the
value is rounded up or down to the closest representable value. The rounding
direction is unspecified.
-It is undefined behavior if the result value does not fit within the range of
-the fixed point type.
+If the result value does not fit within the range of the fixed point type, the
----------------
bjope wrote:
I wonder if there is anything in the code base that really treats overflow as poison. One might think that using scale=0 would give same result as an ordingary `mul` (without `nsw` and `nuw`).
I don't remember, but maybe this maps back to some wording in the Embedded-C spec about fixed point overflow.
https://github.com/llvm/llvm-project/pull/141748
More information about the llvm-commits
mailing list