llvm-project/llvm/unittests/Transforms/Utils
Vedant Kumar 6379a62250 [Local] replaceAllDbgUsesWith: Update debug values before RAUW
The replaceAllDbgUsesWith utility helps passes preserve debug info when
replacing one value with another.

This improves upon the existing insertReplacementDbgValues API by:

- Updating debug intrinsics in-place, while preventing use-before-def of
  the replacement value.
- Falling back to salvageDebugInfo when a replacement can't be made.
- Moving the responsibiliy for rewriting llvm.dbg.* DIExpressions into
  common utility code.

Along with the API change, this teaches replaceAllDbgUsesWith how to
create DIExpressions for three basic integer and pointer conversions:

- The no-op conversion. Applies when the values have the same width, or
  have bit-for-bit compatible pointer representations.
- Truncation. Applies when the new value is wider than the old one.
- Zero/sign extension. Applies when the new value is narrower than the
  old one.

Testing:

- check-llvm, check-clang, a stage2 `-g -O3` build of clang,
  regression/unit testing.
- This resolves a number of mis-sized dbg.value diagnostics from
  Debugify.

Differential Revision: https://reviews.llvm.org/D48676

llvm-svn: 336451
2018-07-06 17:32:39 +00:00
..
ASanStackFrameLayoutTest.cpp [asan] Add a full redzone after every stack variable 2017-11-18 01:13:18 +00:00
BasicBlockUtils.cpp Revert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor" 2018-06-18 23:20:08 +00:00
CMakeLists.txt [PR16756] Add SSAUpdaterBulk. 2018-04-09 23:37:20 +00:00
Cloning.cpp [CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit. 2018-03-06 13:12:32 +00:00
CodeExtractor.cpp [CodeExtractor] Fix multiple bugs under certain shape of extracted region 2017-10-06 03:37:06 +00:00
FunctionComparator.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
IntegerDivision.cpp Remove getArgumentList() in favor of arg_begin(), args(), etc 2017-03-16 22:59:15 +00:00
Local.cpp [Local] replaceAllDbgUsesWith: Update debug values before RAUW 2018-07-06 17:32:39 +00:00
OrderedInstructions.cpp Add a dominanance check interface that uses caching for instructions within same basic block. 2017-06-06 02:34:41 +00:00
SSAUpdaterBulk.cpp Revert "Revert r330403 and r330413." 2018-04-20 13:34:32 +00:00
ValueMapperTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00