Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,10 @@ void AArch64InstPrinter::printAlignedLabel(const MCInst *MI, uint64_t Address,
unsigned OpNum,
const MCSubtargetInfo &STI,
raw_ostream &O) {
// Do not print the numberic target address when symbolizing.
if (SymbolizeOperands)
return;

const MCOperand &Op = MI->getOperand(OpNum);

// If the label has already been resolved to an immediate offset (say, when
Expand Down Expand Up @@ -1813,6 +1817,12 @@ void AArch64InstPrinter::printAdrAdrpLabel(const MCInst *MI, uint64_t Address,
unsigned OpNum,
const MCSubtargetInfo &STI,
raw_ostream &O) {
// Do not print the numberic target address when symbolizing.
// However, do print for ADRP, as this is typically used together with an ADD
// or an immediate-offset ldr/str and the label is likely at the wrong point.
if (SymbolizeOperands && MI->getOpcode() != AArch64::ADRP)
return;

const MCOperand &Op = MI->getOperand(OpNum);

// If the label has already been resolved to an immediate offset (say, when
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# RUN: yaml2obj %s -o %t
# RUN: llvm-objdump %t -d --symbolize-operands --no-show-raw-insn --no-leading-addr | \
# RUN: FileCheck %s --match-full-lines
# RUN: llvm-objdump %t -d --symbolize-operands --no-show-raw-insn --no-leading-addr --adjust-vma=0x2000 | \
# RUN: FileCheck %s --match-full-lines

## Expect to find the branch labels and global variable name.
# CHECK: <_start>:
# CHECK-NEXT: ldr x0, <symbol>
# CHECK-NEXT: <L0>:
# CHECK-NEXT: adrp x1, 0x{{[68]}}000 <symbol+0xff4>
# CHECK-NEXT: adr x2, <symbol>
# CHECK-NEXT: cmp x1, x2
# CHECK-NEXT: b.eq <L1>
# CHECK-NEXT: b <L0>
# CHECK-NEXT: <L1>:
# CHECK-NEXT: cbz x2, <L0>
# CHECK-NEXT: ret

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_AARCH64
Sections:
- Name: .text
Type: SHT_PROGBITS
Address: 0x4000
Flags: [SHF_ALLOC, SHF_EXECINSTR]
Content: '60800058010000d0228000103f0002eb40000054fcffff1762ffffb4c0035fd6'
- Name: .data
Type: SHT_PROGBITS
Flags: [SHF_ALLOC, SHF_WRITE]
Address: 0x5000
Symbols:
- Name: _start
Section: .text
Value: 0x4000
- Name: symbol
Section: .data
Value: 0x500c
3 changes: 2 additions & 1 deletion llvm/tools/llvm-objdump/llvm-objdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,9 @@ collectLocalBranchTargets(ArrayRef<uint8_t> Bytes, MCInstrAnalysis *MIA,
// Supported by certain targets.
const bool isPPC = STI->getTargetTriple().isPPC();
const bool isX86 = STI->getTargetTriple().isX86();
const bool isAArch64 = STI->getTargetTriple().isAArch64();
const bool isBPF = STI->getTargetTriple().isBPF();
if (!isPPC && !isX86 && !isBPF)
if (!isPPC && !isX86 && !isAArch64 && !isBPF)
return;

if (MIA)
Expand Down
2 changes: 1 addition & 1 deletion mlir/include/mlir/Dialect/Arith/IR/ArithOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ def Arith_ScalingExtFOp
// TruncIOp
//===----------------------------------------------------------------------===//

def Arith_TruncIOp : Op<Arith_Dialect, "trunci",
def Arith_TruncIOp : Arith_Op<"trunci",
[Pure, SameOperandsAndResultShape, SameInputOutputTensorDims,
DeclareOpInterfaceMethods<CastOpInterface>,
DeclareOpInterfaceMethods<InferIntRangeInterface, ["inferResultRanges"]>,
Expand Down
Loading