[all-commits] [llvm/llvm-project] 7b1cb7: [SROA] Switch replacement of dead/UB/unreachable o...

Nuno Lopes via All-commits all-commits at lists.llvm.org
Mon Jan 10 06:06:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b1cb72ad944b460c42adf6df635263064a457f3
      https://github.com/llvm/llvm-project/commit/7b1cb72ad944b460c42adf6df635263064a457f3
  Author: Nuno Lopes <nuno.lopes at tecnico.ulisboa.pt>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M clang/test/CodeGen/aarch64-bf16-ldst-intrinsics.c
    M llvm/lib/Transforms/Scalar/SROA.cpp
    M llvm/test/Transforms/SROA/basictest-opaque-ptrs.ll
    M llvm/test/Transforms/SROA/basictest.ll
    M llvm/test/Transforms/SROA/non-capturing-call.ll
    M llvm/test/Transforms/SROA/phi-and-select.ll

  Log Message:
  -----------
  [SROA] Switch replacement of dead/UB/unreachable ops from undef to poison

SROA has 3 data-structures where it stores sets of instructions that should
be deleted:
 - DeadUsers -> instructions that are UB or have no users
 - DeadOperands -> instructions that are UB or operands of useless phis
 - DeadInsts -> "dead" instructions, including loads of uninitialized memory
with users

The first 2 sets can be RAUW with poison instead of undef. No brainer as UB
can be replaced with poison, and for instructions with no users RAUW is a
NOP.

The 3rd case cannot be currently replaced with poison because the set mixes
the loads of uninit memory. I leave that alone for now.

Another case where we can use poison is in the construction of vectors from
multiple loads. The base vector for the first insertelement is now poison as
it doesn't matter as it is fully overwritten by inserts.

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




More information about the All-commits mailing list