Skip to content

Commit

Permalink
Revert "[DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR4…
Browse files Browse the repository at this point in the history
…7927)"

This reverts commit 9905346.

It breaks the compiler-rt build, see https://reviews.llvm.org/D89838
  • Loading branch information
vedantk committed Oct 29, 2020
1 parent 4fe81b6 commit ffba94a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 45 deletions.
18 changes: 6 additions & 12 deletions llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,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), BitSize);
emitLegacyZExt(PrevConvertOp->getArg(0));
PrevConvertOp = None;
} else {
PrevConvertOp = Op;
Expand Down Expand Up @@ -654,17 +654,11 @@ void DwarfExpression::emitLegacySExt(unsigned FromBits) {
emitOp(dwarf::DW_OP_or);
}

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

/// Emit location information expressed via WebAssembly location + offset
/// The Index is an identifier for locals, globals or operand stack.
Expand Down
32 changes: 0 additions & 32 deletions llvm/test/DebugInfo/X86/legacy-zext.ll

This file was deleted.

0 comments on commit ffba94a

Please sign in to comment.