[PATCH] D114492: [PowerPC][llvm-objdump] enable --symbolize-operands for PowerPC ELF/XCOFF.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 05:06:52 PST 2021


shchenz added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/ELF/PowerPC/disassemble-symbolize-operands.ll:29
+
+define i32 @internal(i32 %a) {
+entry:
----------------
we can add an `internal` attribute for the `internal` function to make sure it is internally called in the function `foo`. For now, it is not internally called. I saw two external calls there.

Linux system objdump can dump the internal function call as:
```
  78:   89 ff ff 4b     bl      0 <internal>
```

So it's better llvm-objdump can also dump the internal function call like this.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1002
       bool TargetKnown = MIA->evaluateBranch(Inst, Index, Size, Target);
+      // On PowerPc, if the address of a branch is the same as the target, it
+      // means that it's a function call. Do not mark the label for this case.
----------------
s/PowerPc/PowerPC/g


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1006
+          !Labels.count(Target) &&
+          !(STI->getTargetTriple().isPPC() && Target == Index))
         Labels[Target] = ("L" + Twine(LabelCount++)).str();
----------------
Can this logic be added in `PPCMCInstrAnalysis`? So we don't need the target check here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114492/new/

https://reviews.llvm.org/D114492



More information about the llvm-commits mailing list