[PATCH] D104641: [LICM] Strip context sensitive attributes after call hoisting

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 07:30:22 PDT 2021


anna added a comment.

In D104641#2830481 <https://reviews.llvm.org/D104641#2830481>, @lebedev.ri wrote:

> Should this not be integrated into `Instruction::hasMetadataOtherThanDebugLoc()`/`Instruction::dropUnknownNonDebugMetadata()` ?

I'm not too sure frankly. There's two differences, so if we integrate it, we will need something to reflect that in the name:

1. Attribute stripping is only for calls. On other instructions, attributes are needed for correctness (while metadata is just for performance and can be stripped without any impact on correctness).
2. As mentioned in #1, there are attributes that are needed for correctness. So, we keep a whitelist of attributes we can legally strip from the call parameters.

On the other hand though, it makes sense to strip such attributes not just in hoisting, but also when instructions are "moved"/cloned to another location (such as stripping metadata done in SimplifyCFG). So, I can see a case for integrating this into the functionality where we drop unknown metadata.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104641/new/

https://reviews.llvm.org/D104641



More information about the llvm-commits mailing list