Lines Matching +full:html +full:- +full:export
27 ----------------------------------------
34 The purpose of this rule is to ensure that common block-local optimizations
41 * Instruction scheduling. Block-local instruction reordering should not drop
42 source locations, even though this may lead to jumpy single-stepping
76 -----------------------------------
89 single-stepping (or breakpoint) behavior. Often, merged instructions are memory
94 misattributed to a block containing one of the instructions-to-be-merged.
105 * Merging identical loop-invariant stores (see the LICM utility
120 * Block-local peepholes which delete redundant instructions, like
130 * Converting an if-then-else CFG diamond into a ``select``. Preserving the
133 single-stepping experience. The rule for
146 ------------------------------------
153 The purpose of this rule is to prevent erratic or misleading single-stepping
158 defaults to allowing the last-set location after a label to cascade forward, or
169 Deleting an IR-level Instruction
170 --------------------------------
183 it. This makes a best-effort attempt to rewrite debug uses of the dying
190 .. code-block:: llvm
203 .. code-block:: llvm
217 .. code-block:: cpp
223 .. code-block:: llvm
235 Deleting a MIR-level MachineInstr
236 ---------------------------------
254 Mutation testing for IR-level transformations
255 ---------------------------------------------
265 ``check-debugify``.
276 .. code-block:: llvm
287 and after running ``opt -debugify``:
289 .. code-block:: llvm
307 !1 = !DIFile(filename: "debugify-sample.ll", directory: "/")
329 .. code-block:: bash
331 $ opt -debugify -pass-to-test -check-debugify sample.ll
333 This will inject synthetic DI to ``sample.ll`` run the ``pass-to-test`` and
334 then check for missing DI. The ``-check-debugify`` step can of course be
339 .. code-block:: bash
342 $ opt -enable-debugify -pass-to-test sample.ll
345 $ opt -enable-debugify -debugify-quiet -pass-to-test sample.ll
347 # Prepend -debugify before and append -check-debugify -strip after
348 # each pass on the pipeline (similar to -verify-each).
349 $ opt -debugify-each -O2 sample.ll
351 In order for ``check-debugify`` to work, the DI must be coming from
356 .. code-block:: bash
358 $ opt -debugify < sample.ll | llc -o -
360 There is also a MIR-level debugify pass that can be run before each backend
362 :ref:`Mutation testing for MIR-level transformations<MIRDebugify>`.
379 ------------------------------------------------------
383 pre-existing debug info metadata. It could be run as follows:
385 .. code-block:: bash
388 $ opt -verify-debuginfo-preserve -pass-to-test sample.ll
391 $ opt -verify-each-debuginfo-preserve -O2 sample.ll
395 .. code-block:: bash
398 $ opt -verify-each-debuginfo-preserve -O2 -debugify-func-limit=100 sample.ll
400 Please do note that running ``-verify-each-debuginfo-preserve`` on big projects
402 ``-debugify-func-limit`` with a suitable limit number to prevent extremely long
405 Furthermore, there is a way to export the issues that have been found into
408 .. code-block:: bash
410 $ opt -verify-debuginfo-preserve -verify-di-preserve-export=sample.json -pass-to-test sample.ll
412 and then use the ``llvm/utils/llvm-original-di-preservation.py`` script
413 to generate an HTML page with the issues reported in a more human readable form
416 .. code-block:: bash
418 $ llvm-original-di-preservation.py sample.json sample.html
420 Testing of original debug info preservation can be invoked from front-end level
423 .. code-block:: bash
426 $ clang -Xclang -fverify-debuginfo-preserve -g -O2 sample.c
428 # Test each pass and export the issues report into the JSON file.
429 $ clang -Xclang -fverify-debuginfo-preserve -Xclang -fverify-debuginfo-preserve-export=sample.json -g -O2 sample.c
434 Mutation testing for MIR-level transformations
435 ----------------------------------------------
438 :ref:`Mutation testing for IR-level transformations<IRDebugify>` can be used
439 for MIR-level transformations as well: much like the IR-level pass,
440 ``mir-debugify`` inserts sequentially increasing line locations to each
441 ``MachineInstr`` in a ``Module``. And the MIR-level ``mir-check-debugify`` is
442 similar to IR-level ``check-debugify`` pass.
446 .. code-block:: llvm
450 bb.1 (%ir-block.0):
457 and after running ``llc -run-pass=mir-debugify``:
459 .. code-block:: llvm
463 bb.0 (%ir-block.0):
464 %0:_(s32) = IMPLICIT_DEF debug-location !12
465 DBG_VALUE %0(s32), $noreg, !9, !DIExpression(), debug-location !12
466 %1:_(s32) = IMPLICIT_DEF debug-location !13
467 DBG_VALUE %1(s32), $noreg, !11, !DIExpression(), debug-location !13
468 %2:_(s32) = G_CONSTANT i32 2, debug-location !14
469 DBG_VALUE %2(s32), $noreg, !9, !DIExpression(), debug-location !14
470 %3:_(s32) = G_ADD %0, %2, debug-location !DILocation(line: 4, column: 1, scope: !6)
471 DBG_VALUE %3(s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !6)
472 %4:_(s32) = G_SUB %3, %1, debug-location !DILocation(line: 5, column: 1, scope: !6)
473 DBG_VALUE %4(s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !6)
475 By default, ``mir-debugify`` inserts ``DBG_VALUE`` instructions **everywhere**
476 it is legal to do so. In particular, every (non-PHI) machine instruction that
480 ``DBG_VALUE``'s can be disabled by setting ``-debugify-level=locations``.
482 To run MIRDebugify once, simply insert ``mir-debugify`` into your ``llc``
485 .. code-block:: bash
488 $ llc -run-pass=mir-debugify,other-pass ...
491 $ llc -run-pass=other-pass,mir-debugify ...
494 ``-debugify-and-strip-all-safe``. This can be combined with ``-start-before``
495 and ``-start-after``. For example:
497 .. code-block:: bash
499 $ llc -debugify-and-strip-all-safe -run-pass=... <other llc args>
500 $ llc -debugify-and-strip-all-safe -O1 <other llc args>
503 ``-debugify-check-and-strip-all-safe``. This can also be combined with
504 ``-start-before`` and ``-start-after``. For example:
506 .. code-block:: bash
508 $ llc -debugify-check-and-strip-all-safe -run-pass=... <other llc args>
509 $ llc -debugify-check-and-strip-all-safe -O1 <other llc args>
511 To check all debug info from a test, use ``mir-check-debugify``, like:
513 .. code-block:: bash
515 $ llc -run-pass=mir-debugify,other-pass,mir-check-debugify
517 To strip out all debug info from a test, use ``mir-strip-debug``, like:
519 .. code-block:: bash
521 $ llc -run-pass=mir-debugify,other-pass,mir-strip-debug
523 It can be useful to combine ``mir-debugify``, ``mir-check-debugify`` and/or
524 ``mir-strip-debug`` to identify backend transformations which break in
529 .. code-block:: bash
531 $ llvm-lit test/CodeGen/AArch64 -Dllc="llc -debugify-and-strip-all-safe"
534 --------------------------