[all-commits] [llvm/llvm-project] d47984: [InstCombine] Fold `(x == y) ? 0 : (x > y ? 1 : -1...

Volodymyr Vasylkun via All-commits all-commits at lists.llvm.org
Mon Sep 23 07:41:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4798498c4a30efb03eebb56415a69fa60107414
      https://github.com/llvm/llvm-project/commit/d4798498c4a30efb03eebb56415a69fa60107414
  Author: Volodymyr Vasylkun <vvmposeydon at gmail.com>
  Date:   2024-09-23 (Mon, 23 Sep 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/compare-3way.ll
    M llvm/test/Transforms/InstCombine/scmp.ll
    M llvm/test/Transforms/InstCombine/select-select.ll
    M llvm/test/Transforms/InstCombine/sink_to_unreachable.ll
    M llvm/test/Transforms/InstCombine/ucmp.ll

  Log Message:
  -----------
  [InstCombine] Fold `(x == y) ? 0 : (x > y ? 1 : -1)` into `ucmp/scmp(x,y)` (#107314)

This also handles commuted cases of the same fold, with either the
condition or the true/false values of the inner select being swapped.



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