[PATCH] D27361: [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation so we can stop using DW_OP_bit_piece with the wrong semantics.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 12:02:04 PST 2016


aprantl created this revision.
aprantl added reviewers: dblaikie, dexonsmith.
aprantl added a subscriber: llvm-commits.
aprantl set the repository for this revision to rL LLVM.

The entire back story can be found here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161114/405934.html

The gist is that in LLVM we've been misinterpreting DW_OP_bit_piece's offset field to mean the offset into the source variable rather than the offset into the location at the top the DWARF expression stack. In order to be able to fix this in a subsequent patch, this patch introduces a dedicated DW_OP_LLVM_fragment operation with the semantics that we used to apply to DW_OP_bit_piece, which is what we actually need while inside of LLVM. This patch is complete with a bitcode upgrade for expressions using the old format. It does not yet fix the DWARF backend to use DW_OP_bit_piece correctly.

Implementation note: We discussed several options for implementing this, including reserving a dedicated field in DIExpression for the fragment size and offset, but using an custom operator at the end of the expression works just fine and is more efficient because we then only pay for it when we need it.


Repository:
  rL LLVM

https://reviews.llvm.org/D27361

Files:
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  include/llvm/Support/Dwarf.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
  lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  lib/CodeGen/AsmPrinter/DebugHandlerBase.h
  lib/CodeGen/AsmPrinter/DebugLocEntry.h
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.h
  lib/CodeGen/AsmPrinter/DwarfExpression.cpp
  lib/CodeGen/AsmPrinter/DwarfExpression.h
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfUnit.h
  lib/IR/DIBuilder.cpp
  lib/IR/DebugInfoMetadata.cpp
  lib/IR/Verifier.cpp
  lib/Support/Dwarf.cpp
  lib/Transforms/Scalar/SROA.cpp
  lib/Transforms/Utils/Local.cpp
  test/Assembler/diexpression.ll
  test/Bitcode/DIExpression-4.0.ll
  test/Bitcode/DIExpression-4.0.ll.bc
  test/Bitcode/DIExpression.bc
  test/CodeGen/X86/bit-piece-comment.ll
  test/DebugInfo/AArch64/frameindices.ll
  test/DebugInfo/ARM/PR26163.ll
  test/DebugInfo/ARM/s-super-register.ll
  test/DebugInfo/ARM/split-complex.ll
  test/DebugInfo/ARM/sroa-complex.ll
  test/DebugInfo/COFF/pieces.ll
  test/DebugInfo/Generic/piece-verifier.ll
  test/DebugInfo/X86/PR26148.ll
  test/DebugInfo/X86/array2.ll
  test/DebugInfo/X86/deleted-bit-piece.ll
  test/DebugInfo/X86/nophysreg.ll
  test/DebugInfo/X86/pieces-1.ll
  test/DebugInfo/X86/pieces-2.ll
  test/DebugInfo/X86/pieces-3.ll
  test/DebugInfo/X86/pieces-4.ll
  test/DebugInfo/X86/sroasplit-1.ll
  test/DebugInfo/X86/sroasplit-2.ll
  test/DebugInfo/X86/sroasplit-3.ll
  test/DebugInfo/X86/sroasplit-4.ll
  test/DebugInfo/X86/sroasplit-5.ll
  test/DebugInfo/X86/stack-value-piece.ll
  test/Transforms/Inline/alloca-dbgdeclare.ll
  test/Transforms/SROA/dbg-single-piece.ll
  test/Transforms/Util/split-bit-piece.ll
  unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27361.80109.patch
Type: text/x-patch
Size: 70755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161202/707add48/attachment-0001.bin>


More information about the llvm-commits mailing list