[llvm] [LICM] Fix dropped metadata (PR #95221)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 03:40:33 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Tim Gymnich (tgymnich)

<details>
<summary>Changes</summary>

Fixes  #<!-- -->91919

LICM drops metadata for call instructions when cloning instructions.
This patch just adds the missing `copyMetadata`.

---
Full diff: https://github.com/llvm/llvm-project/pull/95221.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Scalar/LICM.cpp (+1) 


``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 5eccf7b4adb65..75883e0da214d 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -1453,6 +1453,7 @@ static Instruction *cloneInstructionInExitBlock(
     }
 
     New = CallInst::Create(CI, OpBundles);
+    New->copyMetadata(*CI);
   } else {
     New = I.clone();
   }

``````````

</details>


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


More information about the llvm-commits mailing list