[PATCH] D147253: [InstCombine][OpaquePtr] Do not try to match store type to value type for opaque stores

Jeffrey Byrnes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 11:59:15 PDT 2023


jrbyrnes created this revision.
Herald added subscribers: kosarev, kerbowa, hiraditya, jvesely.
Herald added a project: All.
jrbyrnes requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Based on https://github.com/llvm/llvm-project/commit/816d26fe5eeae4adcb0ceda05884747e15f55bb2, it seems the original intent of combineStoreToValueType is to avoid unnecessary bitcasts required to match ptr types of stores. Opaque pointers solves this issue, thus we should not perform this optimization on opaque stores. This optimization currently causes an issue since MergedLoadStoreMotion and SimplifyCFG optimizations are based on finding corresponding ops in different branches -- if the type of stores are conflicting, the optimizations will  miss. We should probably not require type matching on memory ops in these passes, but we should first remove typed ptr handling where it is not needed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147253

Files:
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll
  llvm/test/CodeGen/AMDGPU/vector-alloca-bitcast.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/store-new-type.ll
  llvm/test/Transforms/InstCombine/2012-6-7-vselect-bitcast.ll
  llvm/test/Transforms/InstCombine/X86/blend_x86.ll
  llvm/test/Transforms/InstCombine/X86/pr2645-1.ll
  llvm/test/Transforms/InstCombine/bitcast-phi-uselistorder.ll
  llvm/test/Transforms/InstCombine/cast_phi.ll
  llvm/test/Transforms/InstCombine/icmp-vec.ll
  llvm/test/Transforms/InstCombine/insert-val-extract-elem.ll
  llvm/test/Transforms/InstCombine/load-bitcast-select.ll
  llvm/test/Transforms/InstCombine/load.ll
  llvm/test/Transforms/InstCombine/loadstore-metadata.ll
  llvm/test/Transforms/InstCombine/multiple-uses-load-bitcast-select.ll
  llvm/test/Transforms/InstCombine/pr25342.ll
  llvm/test/Transforms/InstCombine/reduction-and-sext-zext-i1.ll
  llvm/test/Transforms/InstCombine/reduction-or-sext-zext-i1.ll
  llvm/test/Transforms/InstCombine/select.ll
  llvm/test/Transforms/InstCombine/select_meta.ll
  llvm/test/Transforms/InstCombine/shufflevec-bitcast.ll
  llvm/test/Transforms/PhaseOrdering/AMDGPU/vector-alloca-bitcast.ll
  llvm/test/Transforms/PhaseOrdering/bitcast-store-branch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147253.509763.patch
Type: text/x-patch
Size: 278376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230330/1b498a52/attachment-0001.bin>


More information about the llvm-commits mailing list