[asan] Use proper shadow offset for loongarch64 in instrumentation passes
authorYouling Tang <tangyouling@loongson.cn>
Thu, 3 Nov 2022 03:03:37 +0000 (11:03 +0800)
committerWeining Lu <luweining@loongson.cn>
Thu, 3 Nov 2022 03:04:47 +0000 (11:04 +0800)
commitd16b5c350473f04aae4f39344242e140b0dfd79d
tree97f7cfcad00f87d46a67e04fdb97b574a82ee7b9
parent1ada819c237bf724e6eaa1c82b2742e3eb57a5d5
[asan] Use proper shadow offset for loongarch64 in instrumentation passes

Instrumentation passes now use the proper shadow offset. There will be many
asan test failures without this patch. For example:

```
$ ./lib/asan/tests/LOONGARCH64LinuxConfig/Asan-loongarch64-calls-Test
AddressSanitizer:DEADLYSIGNAL
=================================================================
==651209==ERROR: AddressSanitizer: SEGV on unknown address 0x1ffffe2dfa9b (pc 0x5555585e151c bp 0x7ffffb9ec070 sp 0x7ffffb9ebfd0 T0)
==651209==The signal is caused by a UNKNOWN memory access.
```

Before the patch:

```
$ make check-asan
Testing Time: 36.13s
  Unsupported      : 205
  Passed           :  83
  Expectedly Failed:   1
  Failed           : 239
```

After the patch:
```
$ make check-asan
Testing Time: 58.98s
  Unsupported      : 205
  Passed           : 421
  Expectedly Failed:   1
  Failed           :  89
```

Differential Revision: https://reviews.llvm.org/D137013
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp