[llvm] [DAG] Fold fp_to_int(ftrunc(x)) -> fp_to_int(x) (PR #231060)

Eric Ross via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 11 20:29:37 PDT 2026


ZERICO2005 wrote:

`fptrunc` uses the default rounding mode (usually rounds-to-nearest with ties-to-even), so you would have to watch out for double-rounding issues.
```
(int)((bfloat)1.99999988f) = (int)(2.0bf16) = 2
(int)(1.99999988f) = 1
```

https://github.com/llvm/llvm-project/pull/231060


More information about the llvm-commits mailing list