[all-commits] [llvm/llvm-project] 27eaa8: [InstCombine] Prevent infinite loop with two shift...

Maurice Heumann via All-commits all-commits at lists.llvm.org
Thu Dec 5 07:57:49 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27eaa8a40ef338bea611f693fa8e810b1fc8d78d
      https://github.com/llvm/llvm-project/commit/27eaa8a40ef338bea611f693fa8e810b1fc8d78d
  Author: Maurice Heumann <MauriceHeumann at gmail.com>
  Date:   2024-12-05 (Thu, 05 Dec 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    A llvm/test/Transforms/InstCombine/shl-twice-constant.ll

  Log Message:
  -----------
  [InstCombine] Prevent infinite loop with two shifts (#118806)

The following pattern: `(C2 << X) << C1` will usually be transformed
into `(C2 << C1) << X`, essentially swapping `X` and `C1`.

However, this should only be done when `C1` is an immediate constant,
otherwise thiscan lead to both constants being swapped forever.

This fixes #118798.



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