search for: cfi_def_cfa

Displaying 18 results from an estimated 18 matches for "cfi_def_cfa".

2019 Feb 05
2
clang emits calls to consexpr function.
...$cat test.cpp constexpr int product() { return 10*20; } int main() { const int x = product(); return 0; } $./clang test.cpp -std=c++11 -S $./clang -v clang version 9.0.0 Target: x86_64-unknown-linux-gnu $cat test.s main: .cfi_startproc # %bb.0: pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp subq $16, %rsp movl $0, -4(%rbp) callq _Z7productv //here you can see the calls to product function xorl %ecx, %ecx movl %eax, -8(%rbp)...
2018 Sep 14
2
Function calls keep increasing the stack usage
...u > could provide more detail (what target are you compiling for - possibly > provide the -cc1 command line, etc). > > bar: # @bar > .cfi_startproc > # %bb.0: # %entry > pushq %rbp > .cfi_def_cfa_offset 16 > .cfi_offset %rbp, -16 > movq %rsp, %rbp > .cfi_def_cfa_register %rbp > subq $16, %rsp > movl $1, %edi > movl $2, %esi > callq foo > movl $3, %edi > movl $4, %esi >...
2012 Mar 02
3
[LLVMdev] how to annotate assembler
...option -dp (or -dP for more verbose output) to annotate assembler with instruction patterns, that was used when assembler was generated. For example: double test(long long s) { return s; } gcc -S -dp -O0 test.c test: .LFB0: .cfi_startproc pushq %rbp # 18 *pushdi2_rex64/1 [length = 1] .cfi_def_cfa_offset 16 movq %rsp, %rbp # 19 *movdi_1_rex64/2 [length = 3] .cfi_offset 6, -16 .cfi_def_cfa_register 6 movq %rdi, -8(%rbp) # 2 *movdi_1_rex64/4 [length = 4] cvtsi2sdq -8(%rbp), %xmm0 # 6 *floatdidf2_sse_interunit/2 [length = 6] leave # 24 leave_rex64 [length = 1] .cfi_def_cfa...
2008 Oct 24
0
[PATCH] linux/x86-64: fix unwind annotations
...--- head-2008-10-24.orig/arch/x86_64/kernel/entry-xen.S 2008-10-24 11:32:19.000000000 +0200 +++ head-2008-10-24/arch/x86_64/kernel/entry-xen.S 2008-10-24 11:33:13.000000000 +0200 @@ -121,9 +121,9 @@ NMI_MASK = 0x80000000 .macro CFI_DEFAULT_STACK start=1,adj=0 .if \start CFI_STARTPROC simple - CFI_DEF_CFA rsp,SS+8-(\adj*ARGOFFSET) + CFI_DEF_CFA rsp,SS+8 - \adj*ARGOFFSET .else - CFI_DEF_CFA_OFFSET SS+8-(\adj*ARGOFFSET) + CFI_DEF_CFA_OFFSET SS+8 - \adj*ARGOFFSET .endif .if \adj == 0 CFI_REL_OFFSET r15,R15 @@ -133,20 +133,20 @@ NMI_MASK = 0x80000000 CFI_REL_OFFSET rbp,RBP CFI_REL_OFFSET rbx...
2014 Aug 08
4
[LLVMdev] Efficient Pattern matching in Instruction Combine
..._scanf movl 20(%esp), %eax * orl 24(%esp), %eax* addl $28, %esp retl As seen, optimization happened at IR level itself reflected in .s file. *GCC output for the same:* suyog at suyog-Inspiron-N5010:~$ gcc -S -O2 1.c main: .LFB23: .cfi_startproc pushl %ebp .cfi_def_cfa_offset 8 .cfi_offset 5, -8 movl %esp, %ebp .cfi_def_cfa_register 5 andl $-16, %esp subl $32, %esp leal 28(%esp), %eax movl %eax, 8(%esp) leal 24(%esp), %eax movl %eax, 4(%esp) movl $.LC0, (%esp) call __isoc99_scanf movl 2...
2020 Jul 03
2
Exceptions not getting caught on bare-metal target
...the PC of the call-site, i.e. the return address of unw_getcontext and that is that we are doing as well. Is there some other target hook in LLVM or libunwind that we need to implement in order to get this to work? Or are we not emitting enough/correct CFI instructions (currently we only emit .cfi_def_cfa in the prolog, we don't have any callee-saved registers). Speaking of calling conventions: our target is special in that registers are automatically pushed to a special save area upon executing a call, and automatically restored when executing a return instruction. I assume we need to impl...
2010 Sep 10
4
[LLVMdev] using GCC LTO files as a frontend to dragonegg?
...dragonegg]$ gcc-4.5 -S -x lto hello.o [mdaniels at dn002 dragonegg]$ cat hello.s .file "hello.o" .section .rodata .LC0: .string "Hello World" .text .globl hello .type hello, @function hello: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 movq %rsp, %rbp .cfi_offset 6, -16 .cfi_def_cfa_register 6 movl $.LC0, %edi call puts leave .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size hello, .-hello .ident "GCC: (GNU) 4.5.1" .section .note.GNU-s...
2012 Mar 02
0
[LLVMdev] how to annotate assembler
...ng -S -O0 test.c -mllvm -show-mc-inst -o - _test: ## @test .cfi_startproc ## BB#0: ## %entry pushq %rbp ## <MCInst #2120 PUSH64r ## <MCOperand Reg:106>> Ltmp2: .cfi_def_cfa_offset 16 Ltmp3: .cfi_offset %rbp, -16 movq %rsp, %rbp ## <MCInst #1491 MOV64rr ## <MCOperand Reg:106> ## <MCOperand Reg:114>> Ltmp4: .cfi_def_cfa_register %rbp movq %rdi, -8(%rbp)...
2018 Sep 14
6
Function calls keep increasing the stack usage
Hi everyone, I found that LLVM generates redundant code when calling functions with constant parameters, with optimizations disabled. Consider the following C code snippet: int foo(int x, int y); void bar() { foo(1, 2); foo(3, 4); } Clang/LLVM 6.0 generates the following assembly code: _bar: subl $32, %esp movl $1, %eax movl $2, %ecx movl $1, (%esp) movl $2, 4(%esp) movl %eax, 28(%esp) movl
2018 Sep 11
3
OpenJDK8 failed to work after compiled by LLVM 8 for X86
Hi Dimitry, Thanks for your kind response! Thanks for the commit message of Jung's patch, I found that the bug had been fixed in OpenJDK 12 by Zhengyu https://bugs.openjdk.java.net/browse/JDK-8205965 But only backported to 11. So Jung could backport it for OpenJDK 8, thanks a lot! But I argue that the root cause might be in the compiler side, why clang-3.9.1, gcc-6.4.1 couldn't
2014 Aug 13
2
[LLVMdev] Efficient Pattern matching in Instruction Combine
...gt;>>> >>>> *GCC output for the same:* >>>> >>>> suyog at suyog-Inspiron-N5010:~$ gcc -S -O2 1.c >>>> >>>> main: >>>> .LFB23: >>>> .cfi_startproc >>>> pushl %ebp >>>> .cfi_def_cfa_offset 8 >>>> .cfi_offset 5, -8 >>>> movl %esp, %ebp >>>> .cfi_def_cfa_register 5 >>>> andl $-16, %esp >>>> subl $32, %esp >>>> leal 28(%esp), %eax >>>> movl %eax, 8(%esp)...
2013 Jan 27
0
[LLVMdev] Code compiling in gcc but not llvm
$ gcc -S test.c $ cat test.s .file "test.c" .text .globl __GI___testfunc .hidden __GI___testfunc .type __GI___testfunc, @function __GI___testfunc: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 movl $0, %eax popq %rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size __GI___testfunc, .-__GI___testfunc .globl __testfunc .set __testfunc,__GI___testfunc .weak...
2013 Jan 26
2
[LLVMdev] Code compiling in gcc but not llvm
Hi, This is my first post, sorry if not in the right format. I am stuck at a place where I have a code fragment that runs in normal gcc but fails when I give -fplugin=dragonegg.so extern int *testfunc(); extern __typeof (testfunc) testfunc __asm__ ("" "__GI_testfunc") __attribute__ ((visibility ("hidden"))); extern __typeof(testfunc) __testfunc; extern __typeof
2014 Aug 07
4
[LLVMdev] Efficient Pattern matching in Instruction Combine
Hi, All, Duncan, Rafael, David, Nick. This is regarding pattern matching in InstructionCombine pass. We use 'match' functions many times, but it doesn't do the pattern matching effectively. e.x. Lets take pattern : (A ^ B) | ((B ^ C) ^ A) -> (A ^ B) | C (B ^ A) | ((B ^ C) ^ A) -> (A ^ B) | C Both the patterns above are same, since ^ is commutative in Op0. But,
2012 Mar 02
2
[LLVMdev] how to annotate assembler
...                                 ## @test >        .cfi_startproc > ## BB#0:                                ## %entry >        pushq   %rbp                    ## <MCInst #2120 PUSH64r >                                        ##  <MCOperand Reg:106>> > Ltmp2: >        .cfi_def_cfa_offset 16 > Ltmp3: >        .cfi_offset %rbp, -16 >        movq    %rsp, %rbp              ## <MCInst #1491 MOV64rr >                                        ##  <MCOperand Reg:106> >                                        ##  <MCOperand Reg:114>> > Ltmp4: >  ...
2014 Aug 13
2
[LLVMdev] Efficient Pattern matching in Instruction Combine
...>>>> >>>> GCC output for the same: >>>> >>>> suyog at suyog-Inspiron-N5010:~$ gcc -S -O2 1.c >>>> >>>> main: >>>> .LFB23: >>>> .cfi_startproc >>>> pushl %ebp >>>> .cfi_def_cfa_offset 8 >>>> .cfi_offset 5, -8 >>>> movl %esp, %ebp >>>> .cfi_def_cfa_register 5 >>>> andl $-16, %esp >>>> subl $32, %esp >>>> leal 28(%esp), %eax >>>> movl %eax, 8(%esp)...
2018 Sep 12
2
OpenJDK8 failed to work after compiled by LLVM 8 for X86
...# -- Begin function main > .p2align 4, 0x90 > .type main, at function > main: # @main > .cfi_startproc > # %bb.0: # %entry > pushq %rbp > .cfi_def_cfa_offset 16 > .cfi_offset %rbp, -16 > movq %rsp, %rbp > .cfi_def_cfa_register %rbp > xorps %xmm0, %xmm0 > movups %xmm0, NativeCallStack::EMPTY_STACK+16(%rip) > movups %xmm0, NativeCallStack::EMPTY_STACK(%rip) >...
2020 Jun 22
3
Hardware ASan Generating Unknown Instruction
Hi, I am trying to execute a simple hello world program compiled like so: path/to/compiled/clang -o test --target=aarch64-linux-gnu -march=armv8.5-a -fsanitize=hwaddress --sysroot=/usr/aarch64-linux-gnu/ -L/usr/lib/gcc/aarch64-linux-gnu/10.1.0/ -g test.c However, when I look at the disassembly, there is an unknown instruction listed at 0x2d51c: 000000000002d4c0 main: 2d4c0: ff c3 00 d1