406 changes: 0 additions & 406 deletions lldb/utils/test/README-disasm

This file was deleted.

94 changes: 0 additions & 94 deletions lldb/utils/test/README-lldb-disasm

This file was deleted.

18 changes: 0 additions & 18 deletions lldb/utils/test/README-run-until-faulted

This file was deleted.

238 changes: 0 additions & 238 deletions lldb/utils/test/disasm.py

This file was deleted.

294 changes: 0 additions & 294 deletions lldb/utils/test/lldb-disasm.py

This file was deleted.

116 changes: 0 additions & 116 deletions lldb/utils/test/llvm-mc-shell.py

This file was deleted.

13 changes: 0 additions & 13 deletions lldb/utils/test/main.c

This file was deleted.

182 changes: 0 additions & 182 deletions lldb/utils/test/ras.py

This file was deleted.

144 changes: 0 additions & 144 deletions lldb/utils/test/run-dis.py

This file was deleted.

131 changes: 0 additions & 131 deletions lldb/utils/test/run-until-faulted.py

This file was deleted.

23 changes: 13 additions & 10 deletions llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
if (Encoding == dwarf::DW_ATE_signed)
emitLegacySExt(PrevConvertOp->getArg(0));
else if (Encoding == dwarf::DW_ATE_unsigned)
emitLegacyZExt(PrevConvertOp->getArg(0));
emitLegacyZExt(PrevConvertOp->getArg(0), BitSize);
PrevConvertOp = None;
} else {
PrevConvertOp = Op;
Expand Down Expand Up @@ -638,23 +638,26 @@ void DwarfExpression::addFragmentOffset(const DIExpression *Expr) {
void DwarfExpression::emitLegacySExt(unsigned FromBits) {
// (((X >> (FromBits - 1)) * (~0)) << FromBits) | X
emitOp(dwarf::DW_OP_dup);
emitOp(dwarf::DW_OP_constu);
emitUnsigned(FromBits - 1);
emitConstu(FromBits - 1);
emitOp(dwarf::DW_OP_shr);
emitOp(dwarf::DW_OP_lit0);
emitOp(dwarf::DW_OP_not);
emitOp(dwarf::DW_OP_mul);
emitOp(dwarf::DW_OP_constu);
emitUnsigned(FromBits);
emitConstu(FromBits);
emitOp(dwarf::DW_OP_shl);
emitOp(dwarf::DW_OP_or);
}

void DwarfExpression::emitLegacyZExt(unsigned FromBits) {
// (X & (1 << FromBits - 1))
emitOp(dwarf::DW_OP_constu);
emitUnsigned((1ULL << FromBits) - 1);
emitOp(dwarf::DW_OP_and);
void DwarfExpression::emitLegacyZExt(unsigned FromBits, unsigned ToBits) {
if (FromBits < 64) {
// X & ((1 << FromBits) - 1)
emitConstu((1ULL << FromBits) - 1);
emitOp(dwarf::DW_OP_and);
} else {
addOpPiece(FromBits, 0);
emitOp(dwarf::DW_OP_lit0);
addOpPiece(ToBits - FromBits, FromBits);
}
}

void DwarfExpression::addWasmLocation(unsigned Index, uint64_t Offset) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class DwarfExpression {
void addFragmentOffset(const DIExpression *Expr);

void emitLegacySExt(unsigned FromBits);
void emitLegacyZExt(unsigned FromBits);
void emitLegacyZExt(unsigned FromBits, unsigned ToBits);

/// Emit location information expressed via WebAssembly location + offset
/// The Index is an identifier for locals, globals or operand stack.
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/DebugInfo/X86/convert-debugloc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
; NOCONV: DW_TAG_formal_parameter
; NOCONV: DW_TAG_variable
; NOCONV: DW_AT_location (
; NOCONV: {{.*}}, DW_OP_dup, DW_OP_constu 0x7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_constu 0x8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
; NOCONV: {{.*}}, DW_OP_dup, DW_OP_lit7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_lit8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
; NOCONV: DW_AT_name ("y")
; NOCONV: NULL
; NOCONV: DW_TAG_base_type
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/DebugInfo/X86/convert-inlined.ll
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
; DW4: DW_TAG_compile_unit
; DW4: DW_TAG_variable
; DW4: DW_AT_name ("global")
; DW4: DW_AT_location (DW_OP_addr 0x0, DW_OP_deref, DW_OP_dup, DW_OP_constu 0x7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_constu 0x8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
; DW4: DW_AT_location (DW_OP_addr 0x0, DW_OP_deref, DW_OP_dup, DW_OP_lit7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_lit8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
; DW4: DW_TAG_base_type
; DW4: DW_AT_name ("int")
; DW4: NULL
Expand Down
32 changes: 32 additions & 0 deletions llvm/test/DebugInfo/X86/legacy-zext.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s

; CHECK: DW_AT_location (DW_OP_breg5 RDI+0, DW_OP_piece 0x8, DW_OP_lit0, DW_OP_bit_piece 0x40 0x40)

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @t(i64 %x) !dbg !6 {
call void @llvm.dbg.value(metadata i64 %x, metadata !9,
metadata !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned,
DW_OP_LLVM_convert, 128, DW_ATE_unsigned)), !dbg !11
ret void, !dbg !11
}

declare void @llvm.dbg.value(metadata, metadata, metadata)

!llvm.dbg.cu = !{!0}
!llvm.debugify = !{!3, !4}
!llvm.module.flags = !{!5}

!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "legacy-zext.ll", directory: "/")
!2 = !{}
!3 = !{i64 2}
!4 = !{i64 1}
!5 = !{i64 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(name: "t", linkageName: "t", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
!7 = !DISubroutineType(types: !2)
!8 = !{!9}
!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)
!10 = !DIBasicType(name: "ty128", size: 128, encoding: DW_ATE_unsigned)
!11 = !DILocation(line: 1, column: 1, scope: !6)