llvm.org GIT mirror llvm / bf9338a
Merging r304537: ------------------------------------------------------------------------ r304537 | john.brawn | 2017-06-02 06:24:14 -0400 (Fri, 02 Jun 2017) | 9 lines [GlobalMerge] Don't merge globals that may be preempted When a global may be preempted it needs to be accessed directly, instead of indirectly through a MergedGlobals symbol, for the preemption to work. This fixes PR33136. Differential Revision: https://reviews.llvm.org/D33727 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@305187 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
558558 if (GV.isDeclaration() || GV.isThreadLocal() || GV.hasSection())
559559 continue;
560560
561 // It's not safe to merge globals that may be preempted
562 if (TM && !TM->shouldAssumeDSOLocal(M, &GV))
563 continue;
564
561565 if (!(MergeExternalGlobals && GV.hasExternalLinkage()) &&
562566 !GV.hasInternalLinkage())
563567 continue;
11 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=true | FileCheck %s --check-prefix=CHECK-MERGE
22 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=false | FileCheck %s --check-prefix=CHECK-NO-MERGE
33 ; RUN: llc < %s -mtriple=arm-macho -arm-global-merge | FileCheck %s --check-prefix=CHECK-NO-MERGE
4 ; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -relocation-model=pic | FileCheck %s --check-prefix=CHECK-NO-MERGE
45
56 @x = global i32 0, align 4
67 @y = global i32 0, align 4