[llvm] [Local] Make combineAAMetadata() more principled (PR #122091)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 07:31:20 PST 2025


================
@@ -3323,16 +3321,13 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J,
 
     switch (Kind) {
       default:
-        // FIXME: https://github.com/llvm/llvm-project/issues/121495
-        // Change to removing only explicitly listed other metadata, and assert
-        // on unknown metadata, to avoid inadvertently dropping newly added
-        // metadata types.
         K->setMetadata(Kind, nullptr); // Remove unknown metadata
----------------
nikic wrote:

We can't assert on unknown metadata, because metadata is an extension mechanism. You can add `, !foobar !{}` on an instruction with some kind of custom meaning. This metadata has to be dropped in combineMetadata() to be conservatively correct, but we can't assert on encountering it.

https://github.com/llvm/llvm-project/pull/122091


More information about the llvm-commits mailing list