[llvm] [speculative-execution] Hoists debug values unnecessarily. (PR #85782)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 03:41:31 PDT 2024


================
@@ -260,10 +260,31 @@ static InstructionCost ComputeSpeculationCost(const Instruction *I,
   }
 }
 
+// Do not hoist any debug info intrinsics.
+// ...
+// if (cond) {
+//   x = y * z;
+//   foo();
+// }
+// ...
+// -------- Which then becomes:
+// ...
+// if.then:
+//   %x = mul i32 %y, %z
+//   call void @llvm.dbg.value(%x, !"x", !DIExpression())
+//   call void foo()
+//
+// If SpeculativeExecution might decide to hoist the 'y * z' calculation
----------------
OCHyams wrote:

nit: remove `If`?

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


More information about the llvm-commits mailing list