[all-commits] [llvm/llvm-project] 3c4d2a: [SROA] `isVectorPromotionViable()`: memory intrins...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Nov 26 12:19:50 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c4d2a03968ccf5889bacffe02d6fa2443b0260f
      https://github.com/llvm/llvm-project/commit/3c4d2a03968ccf5889bacffe02d6fa2443b0260f
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-11-26 (Sat, 26 Nov 2022)

  Changed paths:
    M clang/test/CodeGenOpenCL/amdgpu-nullptr.cl
    M llvm/lib/Transforms/Scalar/SROA.cpp
    M llvm/test/CodeGen/AMDGPU/v1024.ll
    M llvm/test/DebugInfo/X86/sroasplit-1.ll
    M llvm/test/DebugInfo/X86/sroasplit-4.ll
    M llvm/test/Transforms/PhaseOrdering/instcombine-sroa-inttoptr.ll
    M llvm/test/Transforms/SROA/address-spaces.ll
    M llvm/test/Transforms/SROA/alignment.ll
    M llvm/test/Transforms/SROA/alloca-address-space.ll
    M llvm/test/Transforms/SROA/basictest.ll
    M llvm/test/Transforms/SROA/pointer-offset-size.ll
    M llvm/test/Transforms/SROA/slice-width.ll
    M llvm/test/Transforms/SROA/tbaa-struct.ll
    M llvm/test/Transforms/SROA/tbaa-struct2.ll
    M llvm/test/Transforms/SROA/vector-promotion.ll

  Log Message:
  -----------
  [SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 2)

This is a recommit of cf624b23bc5d5a6161706d1663def49380ff816a,
which was reverted in 5cfc22cafe3f2465e0bb324f8daba82ffcabd0df,
because the cut-off on the number of vector elements was not low enough,
and it triggered both SDAG SDNode operand number assertions,
and caused compile time explosions in some cases.

Let's try with something really *REALLY* conservative first,
just to get somewhere, and try to bump it (to 64/128) later.

FIXME: should this respect TTI reg width * num vec regs?

Original commit message:

Now, there's a big caveat here - these bytes
are abstract bytes, not the i8 we have in LLVM,
so strictly speaking this is not exactly legal,
see e.g. https://github.com/AliveToolkit/alive2/issues/860
^ the "bytes" "could" have been a pointer,
and loading it as an integer inserts an implicit ptrtoint.

But at the same time,
InstCombine's `InstCombinerImpl::SimplifyAnyMemTransfer()`
would expand a memtransfer of 1/2/4/8 bytes
into integer-typed load+store,
so this isn't exactly a new problem.

Note that in memory, poison is byte-wise,
so we really can't widen elements,
but SROA seems to be inconsistent here.

Fixes #59116.




More information about the All-commits mailing list