[all-commits] [llvm/llvm-project] 3e6e54: [X86] Fix miscompile in combineShiftRightArithmeti...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Tue Mar 26 12:53:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e6e54eb795ce7a1ccd47df8c22fc08125a88886
      https://github.com/llvm/llvm-project/commit/3e6e54eb795ce7a1ccd47df8c22fc08125a88886
  Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/sar_fold.ll

  Log Message:
  -----------
  [X86] Fix miscompile in combineShiftRightArithmetic (#86597)

When folding (ashr (shl, x, c1), c2) we need to treat c1 and c2
as unsigned to find out if the combined shift should be a left
or right shift.
Also do an early out during pre-legalization in case c1 and c2
has differet types, as that otherwise complicated the comparison
of c1 and c2 a bit.



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