[all-commits] [llvm/llvm-project] 6f8afa: [InstCombine] Fold `A == MIN_INT ? B != MIN_INT : ...

Veera via All-commits all-commits at lists.llvm.org
Thu Dec 19 06:53:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f8afafd308d37d9abc4af0801dd5a4451c13718
      https://github.com/llvm/llvm-project/commit/6f8afafd308d37d9abc4af0801dd5a4451c13718
  Author: Veera <32646674+veera-sivarajan at users.noreply.github.com>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    A llvm/test/Transforms/InstCombine/select-with-extreme-eq-cond.ll

  Log Message:
  -----------
  [InstCombine] Fold `A == MIN_INT ? B != MIN_INT : A < B` to `A < B` (#120177)

This PR folds:
 `A == MIN_INT ? B != MIN_INT : A < B` to `A < B`
 `A == MAX_INT ? B != MAX_INT : A > B` to `A > B`

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

This helps in optimizing comparison of optional unsigned non-zero types
in https://github.com/rust-lang/rust/issues/49892.

Rust compiler's current output: https://rust.godbolt.org/z/9fxfq3Gn8



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