[all-commits] [llvm/llvm-project] d8b223: [InstCombine] Fold fpto{u, s}i of int-cast fdiv int...

Sungbin Jo via All-commits all-commits at lists.llvm.org
Sun Jul 5 09:58:51 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8b223292490e9abdbce87278044de406e0242f3
      https://github.com/llvm/llvm-project/commit/d8b223292490e9abdbce87278044de406e0242f3
  Author: Sungbin Jo <goranmoomin at daum.net>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    A llvm/test/Transforms/InstCombine/fptoui-of-fdiv.ll

  Log Message:
  -----------
  [InstCombine] Fold fpto{u,s}i of int-cast fdiv into {u,s}div (#205853)

Fixes #205305.

Adds an InstCombine fold for the pattern `fpto{u,s}i (fdiv ({u,s}itofp
X), C)` to `{u,s}div X, C`.

Safe when
- Unsigned: C > 0 and the integer width N <= the FP mantissa width p.
- Signed:  C != 0 and N - 1 <= p, excluding (X == INT_MIN, C == -1). 

See linked issue for detailed reasoning.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list