Chris Lattner
2010-Dec-15 05:37 UTC
[LLVMdev] opinions on turning on encoding info by default in -S
On targets that fully support MC for encoding (today that means X86, hopefully ARM will be done soon), llc has a "-show-mc-encoding" option that can be used to dump out the encodings for every instruction. If you're using clang, this can be accessed with the (intentionally) hidden -mllvm option like so: $ clang t.c -S -o - -mllvm -show-mc-encoding -mkernel -O3 -fomit-frame-pointer .section __TEXT,__text,regular,pure_instructions .globl _tf_bH .align 4, 0x90 _tf_bH: ## @tf_bH ## BB#0: ## %entry ## kill: RSI<def> ESI<kill> movq _last_tf_arg_u at GOTPCREL(%rip), %rax ## encoding: [0x48,0x8b,0x05,A,A,A,A] ## fixup A - offset: 3, value: _last_tf_arg_u at GOTPCREL-4, kind: reloc_riprel_4byte_movq_load movq %rsi, (%rax) ## encoding: [0x48,0x89,0x30] imull $43691, %esi, %eax ## encoding: [0x69,0xc6,0xab,0xaa,0x00,0x00] ## imm = 0xAAAB shrl $17, %eax ## encoding: [0xc1,0xe8,0x11] ret ## encoding: [0xc3] .comm _last_tf_arg_u,8,3 ## @last_tf_arg_u ## @last_tf_arg_u .subsections_via_symbols Relatively recently, we turned on verbose-asm output by default in clang for -S output on targets that support the integrated assembler (which is almost all of them on x86 now). Does anyone have a reason to disable the encoding information? On the one hand it is fairly noisy, on the other hand, it is very useful and is helpful when tuning code for code size. In any case, this doesn't affect normal compile times that use "-c". Thoughts? -Chris
Bob Wilson
2010-Dec-15 16:17 UTC
[LLVMdev] opinions on turning on encoding info by default in -S
On Dec 14, 2010, at 9:37 PM, Chris Lattner wrote:> On targets that fully support MC for encoding (today that means X86, hopefully ARM will be done soon), llc has a "-show-mc-encoding" option that can be used to dump out the encodings for every instruction. If you're using clang, this can be accessed with the (intentionally) hidden -mllvm option like so: > > $ clang t.c -S -o - -mllvm -show-mc-encoding -mkernel -O3 -fomit-frame-pointer > .section __TEXT,__text,regular,pure_instructions > .globl _tf_bH > .align 4, 0x90 > _tf_bH: ## @tf_bH > ## BB#0: ## %entry > ## kill: RSI<def> ESI<kill> > movq _last_tf_arg_u at GOTPCREL(%rip), %rax ## encoding: [0x48,0x8b,0x05,A,A,A,A] > ## fixup A - offset: 3, value: _last_tf_arg_u at GOTPCREL-4, kind: reloc_riprel_4byte_movq_load > movq %rsi, (%rax) ## encoding: [0x48,0x89,0x30] > imull $43691, %esi, %eax ## encoding: [0x69,0xc6,0xab,0xaa,0x00,0x00] > ## imm = 0xAAAB > shrl $17, %eax ## encoding: [0xc1,0xe8,0x11] > ret ## encoding: [0xc3] > > .comm _last_tf_arg_u,8,3 ## @last_tf_arg_u > ## @last_tf_arg_u > > .subsections_via_symbols > > > > Relatively recently, we turned on verbose-asm output by default in clang for -S output on targets that support the integrated assembler (which is almost all of them on x86 now). Does anyone have a reason to disable the encoding information? On the one hand it is fairly noisy, on the other hand, it is very useful and is helpful when tuning code for code size. In any case, this doesn't affect normal compile times that use "-c". > > Thoughts?It's too noisy for my taste, and the situations where that info would be helpful to me are pretty rare. I'd rather have it disabled by default.
Evan Cheng
2010-Dec-16 18:34 UTC
[LLVMdev] opinions on turning on encoding info by default in -S
On Dec 14, 2010, at 9:37 PM, Chris Lattner wrote:> On targets that fully support MC for encoding (today that means X86, hopefully ARM will be done soon), llc has a "-show-mc-encoding" option that can be used to dump out the encodings for every instruction. If you're using clang, this can be accessed with the (intentionally) hidden -mllvm option like so: > > $ clang t.c -S -o - -mllvm -show-mc-encoding -mkernel -O3 -fomit-frame-pointer > .section __TEXT,__text,regular,pure_instructions > .globl _tf_bH > .align 4, 0x90 > _tf_bH: ## @tf_bH > ## BB#0: ## %entry > ## kill: RSI<def> ESI<kill> > movq _last_tf_arg_u at GOTPCREL(%rip), %rax ## encoding: [0x48,0x8b,0x05,A,A,A,A] > ## fixup A - offset: 3, value: _last_tf_arg_u at GOTPCREL-4, kind: reloc_riprel_4byte_movq_load > movq %rsi, (%rax) ## encoding: [0x48,0x89,0x30] > imull $43691, %esi, %eax ## encoding: [0x69,0xc6,0xab,0xaa,0x00,0x00] > ## imm = 0xAAAB > shrl $17, %eax ## encoding: [0xc1,0xe8,0x11] > ret ## encoding: [0xc3] > > .comm _last_tf_arg_u,8,3 ## @last_tf_arg_u > ## @last_tf_arg_u > > .subsections_via_symbols > > > > Relatively recently, we turned on verbose-asm output by default in clang for -S output on targets that support the integrated assembler (which is almost all of them on x86 now). Does anyone have a reason to disable the encoding information? On the one hand it is fairly noisy, on the other hand, it is very useful and is helpful when tuning code for code size. In any case, this doesn't affect normal compile times that use "-c".This cries out for different levels of verbosity. How about printing the encoding information for -verbose-asm=2 (or higher)? Evan> > Thoughts? > > -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Renato Golin
2010-Dec-17 12:05 UTC
[LLVMdev] opinions on turning on encoding info by default in -S
On Thursday, 16 December 2010,> This cries out for different levels of verbosity. How about printing the encoding information for -verbose-asm=2 (or higher)?I concur, the current verbose level is enough for all my needs, now. If/when I start fiddling with MC, I might find that useful, but a special flag would do just fine. Cheers, Renato -- cheers, --renato http://systemcall.org/ Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm
Seemingly Similar Threads
- [LLVMdev] opinions on turning on encoding info by default in -S
- llc tool followed by g++ : Abnormal behavior while compiling assembly to object file
- [LLVMdev] RFC: Exception Handling Rewrite
- llc tool followed by g++ : Abnormal behavior while compiling assembly to object file
- [RFC v3 20/27] x86/ftrace: Adapt function tracing for PIE support