[all-commits] [llvm/llvm-project] bc3551: [InstSimplify] Fold `X * C >= X` to `true` (#129352)

Veera via All-commits all-commits at lists.llvm.org
Sat Mar 1 09:03:18 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc35510725e5d55f7798cc6eb3be7e5f19c38d59
      https://github.com/llvm/llvm-project/commit/bc35510725e5d55f7798cc6eb3be7e5f19c38d59
  Author: Veera <32646674+veera-sivarajan at users.noreply.github.com>
  Date:   2025-03-01 (Sat, 01 Mar 2025)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/icmp-monotonic.ll

  Log Message:
  -----------
  [InstSimplify] Fold `X * C >= X` to `true` (#129352)

Proof: https://alive2.llvm.org/ce/z/T_ocLy

Discovered in: https://github.com/rust-lang/rust/issues/114386

This PR folds `X * C >= X` to `true` when `C` is known to be non-zero
and `mul` is `nuw`.

Folds for other math operators exist already:
https://llvm-ir.godbolt.org/z/GKcYEf5Kb



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