[all-commits] [llvm/llvm-project] 126f90: [DAGCombine] Poison-prove scalarizeExtractedVector...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun May 30 03:56:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 126f90b252509486eab5bfbe06894805b26c8da2
      https://github.com/llvm/llvm-project/commit/126f90b252509486eab5bfbe06894805b26c8da2
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-05-30 (Sun, 30 May 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst.ll
    M llvm/test/CodeGen/SystemZ/vec-extract-02.ll
    M llvm/test/CodeGen/X86/vecloadextract.ll

  Log Message:
  -----------
  [DAGCombine] Poison-prove scalarizeExtractedVectorLoad.

extractelement is poison if the index is out-of-bounds, so just
scalarizing the load may introduce an out-of-bounds load, which is UB.

To avoid introducing new UB, we can mask the index so it only contains
valid indices.

Fixes PR50382.

Reviewed By: efriedma

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




More information about the All-commits mailing list