Skip to content

Commit e848f2b

Browse files
authored
Merge pull request #2068 from apple/revert-2060-eng/PR-70307714
Revert "[DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR47927)"
2 parents 97e7a7e + addad9f commit e848f2b

File tree

3 files changed

+7
-45
lines changed

3 files changed

+7
-45
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
558558
if (Encoding == dwarf::DW_ATE_signed)
559559
emitLegacySExt(PrevConvertOp->getArg(0));
560560
else if (Encoding == dwarf::DW_ATE_unsigned)
561-
emitLegacyZExt(PrevConvertOp->getArg(0), BitSize);
561+
emitLegacyZExt(PrevConvertOp->getArg(0));
562562
PrevConvertOp = None;
563563
} else {
564564
PrevConvertOp = Op;
@@ -650,17 +650,11 @@ void DwarfExpression::emitLegacySExt(unsigned FromBits) {
650650
emitOp(dwarf::DW_OP_or);
651651
}
652652

653-
void DwarfExpression::emitLegacyZExt(unsigned FromBits, unsigned ToBits) {
654-
if (FromBits < 64) {
655-
// X & ((1 << FromBits) - 1)
656-
emitOp(dwarf::DW_OP_constu);
657-
emitUnsigned((1ULL << FromBits) - 1);
658-
emitOp(dwarf::DW_OP_and);
659-
} else {
660-
addOpPiece(FromBits, 0);
661-
emitOp(dwarf::DW_OP_lit0);
662-
addOpPiece(ToBits - FromBits, FromBits);
663-
}
653+
void DwarfExpression::emitLegacyZExt(unsigned FromBits) {
654+
// (X & (1 << FromBits - 1))
655+
emitOp(dwarf::DW_OP_constu);
656+
emitUnsigned((1ULL << FromBits) - 1);
657+
emitOp(dwarf::DW_OP_and);
664658
}
665659

666660
void DwarfExpression::addWasmLocation(unsigned Index, uint64_t Offset) {

llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class DwarfExpression {
351351
void addFragmentOffset(const DIExpression *Expr);
352352

353353
void emitLegacySExt(unsigned FromBits);
354-
void emitLegacyZExt(unsigned FromBits, unsigned ToBits);
354+
void emitLegacyZExt(unsigned FromBits);
355355

356356
/// Emit location information expressed via WebAssembly location + offset
357357
/// The Index is an identifier for locals, globals or operand stack.

llvm/test/DebugInfo/X86/legacy-zext.ll

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)