llvm-project/llvm/test
Adhemerval Zanella dad55c2218 [ARM] [ELF] Fix ARMMaterializeGV for Indirect calls
Recent shouldAssumeDSOLocal changes (introduced by 961f31d8ad)
do not take in consideration the relocation model anymore.  The ARM
fast-isel pass uses the function return to set whether a global symbol
is loaded indirectly or not, and without the expected information
llvm now generates an extra load for following code:

```
$ cat test.ll
@__asan_option_detect_stack_use_after_return = external global i32
define dso_local i32 @main(i32 %argc, i8** %argv) #0 {
entry:
  %0 = load i32, i32* @__asan_option_detect_stack_use_after_return,
align 4
  %1 = icmp ne i32 %0, 0
  br i1 %1, label %2, label %3

2:
  ret i32 0

3:
  ret i32 1
}

attributes #0 = { noinline optnone }

$ lcc test.ll -o -
[...]
main:
        .fnstart
[...]
        movw    r0, :lower16:__asan_option_detect_stack_use_after_return
        movt    r0, :upper16:__asan_option_detect_stack_use_after_return
        ldr     r0, [r0]
        ldr     r0, [r0]
        cmp     r0, #0
[...]
```

And without 'optnone' it produces:
```
[...]
main:
        .fnstart
[...]
        movw    r0, :lower16:__asan_option_detect_stack_use_after_return
        movt    r0, :upper16:__asan_option_detect_stack_use_after_return
        ldr     r0, [r0]
        clz     r0, r0
        lsr     r0, r0, #5
        bx      lr

[...]
```

This triggered a lot of invalid memory access in sanitizers for
arm-linux-gnueabihf.  I checked this patch both a stage1 built with
gcc and a stage2 bootstrap and it fixes all the Linux sanitizers
issues.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D95379
2021-01-26 15:57:55 -03:00
..
Analysis [CostModel] Handle CTLZ and CCTZ in getTypeBasedIntrinsicInstrCost 2021-01-26 14:37:51 +00:00
Assembler [AArch64] Make target intrinsics DefaultAttrIntrinsics. 2021-01-18 17:32:15 +00:00
Bindings
Bitcode
BugPoint
CodeGen [ARM] [ELF] Fix ARMMaterializeGV for Indirect calls 2021-01-26 15:57:55 -03:00
DebugInfo DebugInfo: Generalize the .debug_addr minimization flag to pave the way for including other strategies 2021-01-25 16:24:35 -08:00
Demangle
Examples
ExecutionEngine [JITLink] Disable ELF_ehframe_basic.s test on Windows. 2021-01-26 13:58:38 +11:00
Feature [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
FileCheck [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
Instrumentation [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
Integer
JitListener
LTO [LTO] Add support for existing Config::Freestanding option. 2021-01-22 13:45:39 +00:00
Linker [llvm-link] Fix crash when materializing appending global 2021-01-25 18:08:07 -08:00
MC [AMDGPU][MC] Refactored exp tgt handling 2021-01-26 14:54:15 +03:00
MachineVerifier [Verifier] Add tied-ness verification to statepoint intsruction 2021-01-13 14:40:44 +07:00
Object [Object][WebAssembly] Update format of error messages 2021-01-25 21:12:53 -08:00
ObjectYAML [Object][WebAssembly] Update format of error messages 2021-01-25 21:12:53 -08:00
Other [NewPM][opt] Run the "default" AA pipeline by default 2021-01-21 21:08:54 -08:00
Reduce [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [RISCV] Add way to mark CompressPats that should only be used for compressing. 2021-01-20 09:20:15 -08:00
ThinLTO/X86
Transforms [LoopVectorize] add test for fmin/fmax FMF propagation; NFC 2021-01-26 11:22:51 -05:00
Unit
Verifier [IR] Allow scalable vectors in structs to support intrinsics returning multiple values. 2021-01-17 23:29:51 -08:00
YAMLParser
tools [yaml2obj][obj2yaml] - Improve how we set/dump the sh_entsize field. 2021-01-26 13:33:02 +03:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
lit.site.cfg.py.in