[all-commits] [llvm/llvm-project] 4348cd: [LV] Drop integer poison-generating flags from ins...

Diego Caballero via All-commits all-commits at lists.llvm.org
Mon Nov 22 02:59:32 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4348cd42c385e71b63e5da7e492172cff6a79d7b
      https://github.com/llvm/llvm-project/commit/4348cd42c385e71b63e5da7e492172cff6a79d7b
  Author: Diego Caballero <diegocaballero at google.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-masked-loadstore.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-vector-reverse-mask4.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse-mask4.ll
    M llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
    M llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
    M llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
    M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
    M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-store-accesses-with-gaps.ll
    M llvm/test/Transforms/LoopVectorize/X86/x86-pr39099.ll
    M llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/hoisting-sinking-required-for-vectorization.ll

  Log Message:
  -----------
  [LV] Drop integer poison-generating flags from instructions that need predication

This patch fixes PR52111. The problem is that LV propagates poison-generating flags (`nuw`/`nsw`, `exact`
and `inbounds`) in instructions that contribute to the address computation of widen loads/stores that are
guarded by a condition. It may happen that when the code is vectorized and the control flow within the loop
is linearized, these flags may lead to generating a poison value that is effectively used as the base address
of the widen load/store. The fix drops all the integer poison-generating flags from instructions that
contribute to the address computation of a widen load/store whose original instruction was in a basic block
that needed predication and is not predicated after vectorization.

Reviewed By: fhahn, spatel, nlopes

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




More information about the All-commits mailing list