[all-commits] [llvm/llvm-project] c89d50: [InstCombine] add test for miscompile from select ...

RotateRight via All-commits all-commits at lists.llvm.org
Thu May 6 17:24:35 PDT 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: c89d50033228953d29e835ea5cb8e7066c0d8583
      https://github.com/llvm/llvm-project/commit/c89d50033228953d29e835ea5cb8e7066c0d8583
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-06 (Thu, 06 May 2021)

  Changed paths:
    M llvm/test/Transforms/InstCombine/select-binop-cmp.ll

  Log Message:
  -----------
  [InstCombine] add test for miscompile from select value equivalence; NFC

The new test is reduced from:
https://llvm.org/PR49832
...but we already show a potential miscompile in the existing test too.

(cherry picked from commit c0b0da4684908b8e8143c0762fc766c1a2a5849f)


  Commit: 4a12f51ad0090c3bcfea29c8dd021486ac3aa329
      https://github.com/llvm/llvm-project/commit/4a12f51ad0090c3bcfea29c8dd021486ac3aa329
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-06 (Thu, 06 May 2021)

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

  Log Message:
  -----------
  [InstCombine] fix potential miscompile in select value equivalence

As shown in the example based on:
https://llvm.org/PR49832
...and the existing test, we can't substitute
a vector value because the equality compare
replacement that we are attempting requires
that the comparison is true for the entire
value. Vector select can be partly true/false.

(cherry picked from commit c590a9880d7a660a1c911fce07f3d01ea18be2df)


  Commit: 266c82f94da232d736f413c8d9e08d066c2d7202
      https://github.com/llvm/llvm-project/commit/266c82f94da232d736f413c8d9e08d066c2d7202
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-06 (Thu, 06 May 2021)

  Changed paths:
    M llvm/test/Transforms/InstSimplify/select.ll

  Log Message:
  -----------
  [InstSimplify] add test for vector select with operand replacement; NFC

We need a sibling fix to c590a9880d7a
( https://llvm.org/PR49832 ) to avoid miscompiling.

(cherry picked from commit 78e5cf66fec52c8e6e665c3c9e64d38498d94a5d)


  Commit: 8e2ff387d30d540195ffef299785d392b0ee17dd
      https://github.com/llvm/llvm-project/commit/8e2ff387d30d540195ffef299785d392b0ee17dd
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-06 (Thu, 06 May 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/select.ll

  Log Message:
  -----------
  [InstSimplify] fix potential miscompile in select value equivalence

This is the sibling fix to c590a9880d7a -
as there, we can't subsitute a vector value the equality
compare replacement that we are trying requires that the
comparison is true for the entire value. Vector select
can be partly true/false.

(cherry picked from commit e2a0f512eacad0699be9660f668726d7deb2cd75)


Compare: https://github.com/llvm/llvm-project/compare/225b775620c6...8e2ff387d30d


More information about the All-commits mailing list