[all-commits] [llvm/llvm-project] 6d949a: [InstCombine] restrict funnel shift match to avoid...

RotateRight via All-commits all-commits at lists.llvm.org
Tue May 18 10:39:18 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6d949a9c8fa440b0b91c9a96a30a9b7c1b7cf1e1
      https://github.com/llvm/llvm-project/commit/6d949a9c8fa440b0b91c9a96a30a9b7c1b7cf1e1
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-18 (Tue, 18 May 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/funnel.ll
    M llvm/test/Transforms/InstCombine/rotate.ll

  Log Message:
  -----------
  [InstCombine] restrict funnel shift match to avoid miscompile

As noted in the post-commit discussion for:
https://reviews.llvm.org/rGabd7529625a73f405e40a63dcc446c41d51a219e

...that change exposed a logic hole that allows a miscompile
if the shift amount could exceed the narrow width:
https://alive2.llvm.org/ce/z/-i_CiM
https://alive2.llvm.org/ce/z/NaYz28

The restriction isn't necessary for a rotate (same operand for
both shifts), so we should adjust the matching for the shift
value as a follow-up enhancement:
https://alive2.llvm.org/ce/z/ahuuQb




More information about the All-commits mailing list