[all-commits] [llvm/llvm-project] 7bb8bf: [InstCombine] fix miscompile from vector select su...

RotateRight via All-commits all-commits at lists.llvm.org
Sun May 30 04:12:15 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7bb8bfa0622b8ee55c3f748004dcf4d83d48cf97
      https://github.com/llvm/llvm-project/commit/7bb8bfa0622b8ee55c3f748004dcf4d83d48cf97
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-05-30 (Sun, 30 May 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/InstructionSimplify.h
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select-safe-bool-transforms.ll

  Log Message:
  -----------
  [InstCombine] fix miscompile from vector select substitution

This is similar to the fix in c590a9880d7a ( PR49832 ), but
we missed handling the pattern for select of bools (no compare
inst).

We can't substitute a vector value because the equality condition
replacement that we are attempting requires that the condition
is true/false for the entire value. Vector select can be partly
true/false.

I added an assert for vector types, so we shouldn't hit this again.
Fixed formatting while auditing the callers.

https://llvm.org/PR50500




More information about the All-commits mailing list