[llvm] [LangRef] Clarify definition of fragments and debug intrinsics (PR #82019)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 16:52:22 PST 2024


================
@@ -130,6 +130,40 @@ debugging information influences optimization passes then it will be reported
 as a failure.  See :doc:`TestingGuide` for more information on LLVM test
 infrastructure and how to run various tests.
 
+.. _variables_and_variable_fragments:
+
+Variables and Variable Fragments
+================================
+
+Source language variables (or just "variables") are represented by `local
+variable <LangRef.html#dilocalvariable>`_ and `global variable
+<LangRef.html#diglobalvariable>`_ metadata nodes.
+
+When variables are not allocated to contiguous memory or to a single LLVM value
+the metadata must record enough information to describe each "piece" or
----------------
felipepiovezan wrote:

>  Maybe rather than starting with the "reason" for fragments 

I think you make a good point here. We don't need to justify the reason for fragments here (arguably it is self evident); we can just state what fragments are:

"A variable may be described in terms of fragments, where a fragment is a contiguous span of bits. This is achieved by ... [rest of the second paragraph]".

If we want to provide motivation, we can do so later through an example or just state in high level terms one code transformation that may cause fragments to appear.

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


More information about the llvm-commits mailing list