[PATCH] D91444: [InstCombine] Preserve !annotation metadata for memory combines.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 09:49:48 PST 2020


fhahn created this revision.
fhahn added reviewers: thegameg, spatel, RKSimon, jdoerfert, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
fhahn requested review of this revision.

This patch updates a few places in InstCombine and SimplifyLibCalls to
preserve !annotation metadata when it turns calls to memory
functions/intrinsics into loads and stores.

The reason for the focus on memory instructions is that the first
concrete use case is tracking instructions inserted for
auto-initialization (D91417 <https://reviews.llvm.org/D91417>).

Unfortunately there seems to be no convenient single place in
instcombine or SimplifyLibCalls to copy  metadata for all instructions
inserted as part of a combine.

This patch also updates the existing code to use copyMetadata with a
list of node kinds to copy. We may be able to extend this list in the
future or even get rid of it completely.

This patch is based on an earlier patch by Francis Visoiu Mistrih.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91444

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/annotations.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91444.305201.patch
Type: text/x-patch
Size: 8800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201113/ef0fed2f/attachment.bin>


More information about the llvm-commits mailing list