[all-commits] [llvm/llvm-project] 2fea5d: [InstCombine] tmp alloca bypass: ensure that the r...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Wed Apr 14 03:04:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fea5d5d4accf3490854b064a51d1db049b1de64
      https://github.com/llvm/llvm-project/commit/2fea5d5d4accf3490854b064a51d1db049b1de64
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-14 (Wed, 14 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    M llvm/test/Transforms/InstCombine/AMDGPU/memcpy-from-constant.ll
    A llvm/test/Transforms/InstCombine/tmp-alloca-bypass.ll

  Log Message:
  -----------
  [InstCombine] tmp alloca bypass: ensure that the replacement dominates all alloca uses

After 077bff39d46364035a5dcfa32fc69910ad0975d0,
isDereferenceableForAllocaSize() can recurse into selects,
which is causing a problem for the new test case,
reduced from https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20210412/904154.html
because the replacement (the select) is defined after the first use
of an alloca, so we'd end up with a verifier error.

Now, this new check is too restrictive.
We likely can handle *some* cases, by trying to sink all uses of an alloca
to after the the def.




More information about the All-commits mailing list