[all-commits] [llvm/llvm-project] a3e619: [SLP] fix miscompile on min/max reductions with ex...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Nov 13 13:05:33 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a3e61946c5bd7bdfab15af76b292e52d6ffa27f7
      https://github.com/llvm/llvm-project/commit/a3e61946c5bd7bdfab15af76b292e52d6ffa27f7
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2019-11-13 (Wed, 13 Nov 2019)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/X86/reduction.ll
    M llvm/test/Transforms/SLPVectorizer/X86/used-reduced-op.ll

  Log Message:
  -----------
  [SLP] fix miscompile on min/max reductions with extra uses (PR43948)

The bug manifests as replacing a reduction operand with an undef
value.

The problem appears to be limited to cases where a min/max reduction
has extra uses of the compare operand to the select.

In the general case, we are tracking "ExternallyUsedValues" and
an "IgnoreList" of the reduction operations, but those may not apply
to the final compare+select in a min/max reduction.

For that, we use replaceAllUsesWith (RAUW) to ensure that the new
vectorized reduction values are transferred to all subsequent users.

Differential Revision: https://reviews.llvm.org/D70148




More information about the All-commits mailing list