[PATCH] D48468: [SelectionDAG] Remove debug locations from ConstantSD(FP)Nodes
Petr Pavlu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 29 02:28:20 PDT 2018
petpav01 added a comment.
Hi Vedant,
This change also made debug information for the following example slightly worse:
$ cat test.c
void bar(void);
int foo(void) {
bar();
int i = 2;
return i;
}
$ clang -target armv7a-none-eabi -g -c test.c main.c
$ llvm-objdump -S test.o
test.o: file format ELF32-arm-little
Disassembly of section .text:
foo:
; int foo(void) {
0: 00 48 2d e9 push {r11, lr}
4: 0d b0 a0 e1 mov r11, sp
8: 08 d0 4d e2 sub sp, sp, #8
; bar();
c: fe ff ff eb bl #-8 <foo+0xc>
10: 02 e0 a0 e3 mov lr, #2
; int i = 2;
14: 04 e0 8d e5 str lr, [sp, #4]
; return i;
18: 04 00 9d e5 ldr r0, [sp, #4]
1c: 0b d0 a0 e1 mov sp, r11
20: 00 88 bd e8 pop {r11, pc}
Instruction `mov lr, #2` is recorded as part of line 3 (`bar();`) but previously it was more accurately accounted as line 4 (`int i = 2;`).
Previous behaviour:
$ llvm-objdump -S test.o
test.o: file format ELF32-arm-little
Disassembly of section .text:
foo:
; int foo(void) {
0: 00 48 2d e9 push {r11, lr}
4: 0d b0 a0 e1 mov r11, sp
8: 08 d0 4d e2 sub sp, sp, #8
; bar();
c: fe ff ff eb bl #-8 <foo+0xc>
; int i = 2;
10: 02 e0 a0 e3 mov lr, #2
14: 04 e0 8d e5 str lr, [sp, #4]
; return i;
18: 04 00 9d e5 ldr r0, [sp, #4]
1c: 0b d0 a0 e1 mov sp, r11
20: 00 88 bd e8 pop {r11, pc}
It is not clear to me whether this is an expected change but I thought I would let you know about it if it actually isn't.
Thanks,
Petr
Repository:
rL LLVM
https://reviews.llvm.org/D48468
More information about the llvm-commits
mailing list