[llvm] [Transforms] Debug values are not remapped when cloning. (PR #87747)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 21:49:29 PDT 2024


================
@@ -2008,14 +2007,15 @@ void JumpThreadingPass::updateSSA(
 /// Clone instructions in range [BI, BE) to NewBB.  For PHI nodes, we only clone
 /// arguments that come from PredBB.  Return the map from the variables in the
 /// source basic block to the variables in the newly created basic block.
-DenseMap<Instruction *, Value *>
-JumpThreadingPass::cloneInstructions(BasicBlock::iterator BI,
-                                     BasicBlock::iterator BE, BasicBlock *NewBB,
-                                     BasicBlock *PredBB) {
+
+void JumpThreadingPass::cloneInstructions(ValueToValueMapTy &ValueMapping,
+                                          BasicBlock::iterator BI,
+                                          BasicBlock::iterator BE,
+                                          BasicBlock *NewBB,
+                                          BasicBlock *PredBB) {
----------------
CarlosAlbertoEnciso wrote:

Due to the compilation error: `use of deleted function`

```
  // ValueMap can't be copied nor moved, because the callbacks store pointer to
  // it.
  ValueMap(const ValueMap &) = delete;
  ValueMap(ValueMap &&) = delete;
  ValueMap &operator=(const ValueMap &) = delete;
  ValueMap &operator=(ValueMap &&) = delete;
```
`using ValueToValueMapTy = ValueMap<const Value *, WeakTrackingVH>;`

`ValueMap` can't be copied nor moved.


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


More information about the llvm-commits mailing list