Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/DebugInfo/RISCV/relax-debug-frame.ll
; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - \ | ; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - \ | ||||
; RUN: | llvm-readobj -r | FileCheck -check-prefix=RELAX %s | ; RUN: | llvm-readobj -r | FileCheck -check-prefix=RELAX %s | ||||
; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - \ | ; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - \ | ||||
; RUN: | llvm-dwarfdump --debug-frame - \ | ; RUN: | llvm-dwarfdump --debug-frame - \ | ||||
; RUN: | FileCheck -check-prefix=RELAX-DWARFDUMP %s | ; RUN: | FileCheck -check-prefix=RELAX-DWARFDUMP %s | ||||
; | ; | ||||
; RELAX: Section{{.*}}.rela.{{eh|debug}}_frame { | ; RELAX: Section{{.*}}.rela.{{eh|debug}}_frame { | ||||
; RELAX-NOT: {{[}]}} | ; RELAX-NOT: {{[}]}} | ||||
; RELAX-NOT: 0x0 R_RISCV_ADD32 | ; RELAX-NOT: 0x0 R_RISCV_ADD32 | ||||
; RELAX-NOT: 0x0 R_RISCV_SUB32 | ; RELAX-NOT: 0x0 R_RISCV_SUB32 | ||||
; RELAX-NOT: {{[}]}} | ; RELAX-NOT: {{[}]}} | ||||
; RELAX: 0x20 R_RISCV_ADD32 | ; RELAX: 0x20 R_RISCV_ADD32 | ||||
; RELAX: 0x20 R_RISCV_SUB32 | ; RELAX: 0x20 R_RISCV_SUB32 | ||||
; RELAX-NOT: {{[}]}} | ; RELAX-NOT: {{[}]}} | ||||
; RELAX: 0x25 R_RISCV_SET6 | ; RELAX: 0x39 R_RISCV_SET6 | ||||
; RELAX: 0x25 R_RISCV_SUB6 | ; RELAX: 0x39 R_RISCV_SUB6 | ||||
shiva0217: I think it might a reasonable changing. According to https://github.com/riscv/riscv-binutils… | |||||
Thanks, that's exactly the kind of reassuring feedback I was looking for! :-) luismarques: Thanks, that's exactly the kind of reassuring feedback I was looking for! :-) | |||||
Not Done ReplyInline Actions@shiva0217 is right. In DWARF definition, DW_CFA_advance_loc's operand is 6-bits width offset. These two relocation types are for 6-bits offset. These two relocation types should be similar to R_RISCV_ADD32 and R_RISCV_SUB32 besides the data width. HsiangKai: @shiva0217 is right. In DWARF definition, DW_CFA_advance_loc's operand is 6-bits width offset. | |||||
; | ; | ||||
; RELAX-DWARFDUMP: CIE | ; RELAX-DWARFDUMP: CIE | ||||
; RELAX-DWARFDUMP: DW_CFA_advance_loc | ; RELAX-DWARFDUMP: DW_CFA_advance_loc | ||||
; RELAX-DWARFDUMP: DW_CFA_def_cfa_offset | ; RELAX-DWARFDUMP: DW_CFA_def_cfa_offset | ||||
; RELAX-DWARFDUMP: DW_CFA_offset | ; RELAX-DWARFDUMP: DW_CFA_offset | ||||
; RELAX-DWARFDUMP: DW_CFA_restore | |||||
source_filename = "frame.c" | source_filename = "frame.c" | ||||
; Function Attrs: noinline nounwind optnone | ; Function Attrs: noinline nounwind optnone | ||||
define i32 @init() { | define i32 @init() { | ||||
entry: | entry: | ||||
ret i32 0 | ret i32 0 | ||||
} | } | ||||
Show All 32 Lines |
I think it might a reasonable changing. According to https://github.com/riscv/riscv-binutils-gdb/blob/riscv-binutils-2.29/gas/config/tc-riscv.c#L1940, R_RISCV_SET6 and R_RISCV_SUB6 are relocation types for DW_CFA_advance_loc. It seems that the check line didn't show all the relocation types of the object, the number of the reduction of R_RISCV_SET6 and R_RISCV_SUB6 reflect the reduction of the CFI directives.