[all-commits] [llvm/llvm-project] 9f45c5: [InstCombine] Fix infinite loop in select equivale...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Mar 6 00:34:03 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f45c5e1a65a1abf4920b617d36ed05e73c04bea
      https://github.com/llvm/llvm-project/commit/9f45c5e1a65a1abf4920b617d36ed05e73c04bea
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-03-06 (Wed, 06 Mar 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select.ll

  Log Message:
  -----------
  [InstCombine] Fix infinite loop in select equivalence fold (#84036)

When replacing with a non-constant, it's possible that the result of the
simplification is actually more complicated than the original, and may
result in an infinite combine loop.

Mitigate the issue by requiring that either the replacement or
simplification result is constant, which should ensure that it's
simpler. While this check is crude, it does not appear to cause
optimization regressions in real-world code in practice.

Fixes https://github.com/llvm/llvm-project/issues/83127.



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