[all-commits] [llvm/llvm-project] 6da31f: InstCombine: Fix infinite loop in copy-constant-to...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Oct 14 09:55:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6da31fa4a61d68af21dfa1e144e726ed6d77903e
      https://github.com/llvm/llvm-project/commit/6da31fa4a61d68af21dfa1e144e726ed6d77903e
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2020-10-14 (Wed, 14 Oct 2020)

  Changed paths:
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/lib/IR/IRBuilder.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    M llvm/test/Transforms/InstCombine/AMDGPU/memcpy-from-constant.ll

  Log Message:
  -----------
  InstCombine: Fix infinite loop in copy-constant-to-alloca transform

This was broken by 16295d521e294b27106e51fac29957c1aac8ff89, when
instructions started being handled and not just constant
expressions. This was re-inserting an equivalent bitcast to the
original memcpy operand, which made a non-functional IR change on
every iteration.

This also fixes a secondary problem where it was inserting
addrspacecasts which may not have been legal (i.e. it changed the
source address space). Start visiting all pointer users and fail out
if we can't process them. Also start handling the relevant memory
intrinsic users. These cases can be dealt with by running
InferAddressSpaces separately.


  Commit: 6a9484f4bf6c9136f6679ab64a18c11464fd20ca
      https://github.com/llvm/llvm-project/commit/6a9484f4bf6c9136f6679ab64a18c11464fd20ca
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2020-10-14 (Wed, 14 Oct 2020)

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

  Log Message:
  -----------
  InstCombine: Fix losing load properties in copy-constant-to-alloca

Preserve the alignment and metadata. Atomic loads are skipped for
this, but pass along the properties for consistency.


Compare: https://github.com/llvm/llvm-project/compare/0728b67b2718...6a9484f4bf6c


More information about the All-commits mailing list