[PATCH] D76580: [X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 11:49:18 PDT 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-mca/X86/show-encoding.s:58
 # NORMAL-NEXT:         1      1     0.50                        cmpl	%r8d, %esi
-# NORMAL-NEXT:         1      1     0.50                        jl	-90
+# NORMAL-NEXT:         1      1     0.50                        jl	0xffffffffffffffa6
 
----------------
MaskRay wrote:
> andreadb wrote:
> > I find the `jl 0xffffffffffffffa6` less readable than the old `jl -90` to be honest.
> > 
> > For cases like this where the address of the next instruction is unknown (and therefore set to zero), I suggest that we fall back to the old behavior.
> > This case in is particularly annoying here because the Imm value is negative.
> > 
> > Note that this is quite a common pattern for code snippets processed by mca.
> > The branch at the end of a mca code snippet is often a backedge.
> > 
> > I don't know the motivations for this change. However, can we at least avoid to change the value if the PC value is unknown? Just an idea.
> `jl -90` is not an ideal output. The unambiguous form is `jl .-90`
> 
> I'll add a member variable `TargetAddressAsDotRelative` in D72172.
> 
> > I don't know the motivations for this change. 
> 
> call/jump instructions not displaying the target address has always been a great pain for many users. I personally prefer GNU objdump -d just because this issue. 
s/D72172/D76574/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76580





More information about the llvm-commits mailing list