[PATCH] D52125: X86, AArch64, ARM: Do not attach debug location to spill/reload instructions

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 2 13:47:36 PDT 2018


eugenis added a comment.

It's a bug in HWASan where we symbolize the address of the previous instruction, as usual when going up the stack (call instruction is at function return address - 4), but fault address from the signal handler does not need this adjustment. The previous instruction happens to be a reload (with -O0).

I'll fix it.

I've noticed that your change increases the size of .debug_line with HWASan, -gline-tables-only and -O0 by ~50%. Perhaps this is the worst possible case, because HWASan inserts lots of short cold BBs, something like

  if (unlikely(bad_address)) {x0 = addr; brk; unreachable; }

before each memory access, and at -O0 there is often a reload of addr in the cold branch.

This is what the line table looks like:
Contents of the .debug_line section:

CU: /code/llvm-project/compiler-rt/test/hwasan/TestCases/halt-on-error.cc:
File name                            Line number    Starting address    View
halt-on-error.cc                               9                   0
halt-on-error.cc                              10                0xa8
halt-on-error.cc                              11                0xb4
halt-on-error.cc                              11                0xc0
halt-on-error.cc                               0                0xec
halt-on-error.cc                              11                0xf0
halt-on-error.cc                               0                0xf4
halt-on-error.cc                              11                0xfc
halt-on-error.cc                              12               0x104
halt-on-error.cc                               0               0x12c
halt-on-error.cc                              12               0x130
halt-on-error.cc                               0               0x134
halt-on-error.cc                              12               0x138
halt-on-error.cc                              12               0x13c
halt-on-error.cc                              13               0x140
halt-on-error.cc                              14               0x14c
halt-on-error.cc                               0               0x174
halt-on-error.cc                              14               0x178
halt-on-error.cc                               0               0x17c
halt-on-error.cc                              14               0x180
halt-on-error.cc                               0               0x1bc
halt-on-error.cc                              14               0x1c0
halt-on-error.cc                               0               0x1c4
halt-on-error.cc                              14               0x1c8
halt-on-error.cc                              14               0x1d4
halt-on-error.cc                               0               0x200
halt-on-error.cc                              14               0x204
halt-on-error.cc                               0               0x208
halt-on-error.cc                              14               0x20c
halt-on-error.cc                              14               0x210
halt-on-error.cc                               0               0x248
halt-on-error.cc                              14               0x24c
halt-on-error.cc                               0               0x250
halt-on-error.cc                              14               0x254
halt-on-error.cc                              14               0x25c
halt-on-error.cc                              14               0x268
halt-on-error.cc                               0               0x294
halt-on-error.cc                              14               0x298
halt-on-error.cc                               0               0x29c
halt-on-error.cc                              14               0x2a0
halt-on-error.cc                              14               0x2a4
halt-on-error.cc                               0               0x2dc
halt-on-error.cc                              14               0x2e0
halt-on-error.cc                               0               0x2e4
halt-on-error.cc                              14               0x2e8
halt-on-error.cc                              14               0x2f0
halt-on-error.cc                              14               0x2f8
halt-on-error.cc                              14               0x324


Repository:
  rL LLVM

https://reviews.llvm.org/D52125





More information about the llvm-commits mailing list