[llvm-branch-commits] [llvm-branch] r323337 - Merging r322900 and r323307:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 24 07:53:46 PST 2018
Author: hans
Date: Wed Jan 24 07:53:46 2018
New Revision: 323337
URL: http://llvm.org/viewvc/llvm-project?rev=323337&view=rev
Log:
Merging r322900 and r323307:
------------------------------------------------------------------------
r322900 | mstorsjo | 2018-01-18 22:21:48 +0100 (Thu, 18 Jan 2018) | 6 lines
[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.
Previously, these parts weren't ever checked. The label patterns
need to be extended to match successfully on macho.
Differential Revision: https://reviews.llvm.org/D42126
------------------------------------------------------------------------
------------------------------------------------------------------------
r323307 | mstorsjo | 2018-01-24 07:40:04 +0100 (Wed, 24 Jan 2018) | 6 lines
[GlobalMerge] Don't merge dllexport globals
Merging such globals loses the dllexport attribute. Add a test
to check that normal globals still are merged.
Differential Revision: https://reviews.llvm.org/D42127
------------------------------------------------------------------------
Added:
llvm/branches/release_60/test/CodeGen/ARM/global-merge-dllexport.ll
- copied unchanged from r323307, llvm/trunk/test/CodeGen/ARM/global-merge-dllexport.ll
Modified:
llvm/branches/release_60/ (props changed)
llvm/branches/release_60/lib/CodeGen/GlobalMerge.cpp
llvm/branches/release_60/test/CodeGen/ARM/global-merge-external.ll
Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 24 07:53:46 2018
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322053,322056,322103,322106,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322904-322905,322973,322993,323034,323190
+/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322053,322056,322103,322106,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322900,322904-322905,322973,322993,323034,323190,323307
Modified: llvm/branches/release_60/lib/CodeGen/GlobalMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/CodeGen/GlobalMerge.cpp?rev=323337&r1=323336&r2=323337&view=diff
==============================================================================
--- llvm/branches/release_60/lib/CodeGen/GlobalMerge.cpp (original)
+++ llvm/branches/release_60/lib/CodeGen/GlobalMerge.cpp Wed Jan 24 07:53:46 2018
@@ -577,7 +577,8 @@ bool GlobalMerge::doInitialization(Modul
for (auto &GV : M.globals()) {
// Merge is safe for "normal" internal or external globals only
if (GV.isDeclaration() || GV.isThreadLocal() ||
- GV.hasSection() || GV.hasImplicitSection())
+ GV.hasSection() || GV.hasImplicitSection() ||
+ GV.hasDLLExportStorageClass())
continue;
// It's not safe to merge globals that may be preempted
Modified: llvm/branches/release_60/test/CodeGen/ARM/global-merge-external.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/test/CodeGen/ARM/global-merge-external.ll?rev=323337&r1=323336&r2=323337&view=diff
==============================================================================
--- llvm/branches/release_60/test/CodeGen/ARM/global-merge-external.ll (original)
+++ llvm/branches/release_60/test/CodeGen/ARM/global-merge-external.ll Wed Jan 24 07:53:46 2018
@@ -1,8 +1,9 @@
-; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge | FileCheck %s --check-prefix=CHECK-MERGE
-; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=true | FileCheck %s --check-prefix=CHECK-MERGE
-; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=false | FileCheck %s --check-prefix=CHECK-NO-MERGE
-; RUN: llc < %s -mtriple=arm-macho -arm-global-merge | FileCheck %s --check-prefix=CHECK-NO-MERGE
-; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -relocation-model=pic | FileCheck %s --check-prefix=CHECK-NO-MERGE
+; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge | FileCheck %s --check-prefixes=CHECK,CHECK-MERGE
+; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=true | FileCheck %s --check-prefixes=CHECK,CHECK-MERGE
+; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -global-merge-on-external=false | FileCheck %s --check-prefixes=CHECK,CHECK-NO-MERGE
+; RUN: llc < %s -mtriple=arm-macho -arm-global-merge | FileCheck %s --check-prefixes=CHECK,CHECK-NO-MERGE
+; RUN: llc < %s -mtriple=arm-eabi -arm-global-merge -relocation-model=pic | FileCheck %s --check-prefixes=CHECK,CHECK-NO-MERGE
+; RUN: llc < %s -mtriple=thumbv7-win32 -arm-global-merge | FileCheck %s --check-prefixes=CHECK-WIN32
@x = global i32 0, align 4
@y = global i32 0, align 4
@@ -10,10 +11,13 @@
define void @f1(i32 %a1, i32 %a2) {
;CHECK: f1:
-;CHECK: ldr {{r[0-9]+}}, [[LABEL1:\.LCPI[0-9]+_[0-9]]]
+;CHECK: ldr {{r[0-9]+}}, [[LABEL1:\.?LCPI[0-9]+_[0-9]]]
;CHECK: [[LABEL1]]:
;CHECK-MERGE: .long .L_MergedGlobals
;CHECK-NO-MERGE: .long {{_?x}}
+;CHECK-WIN32: f1:
+;CHECK-WIN32: movw [[REG1:r[0-9]+]], :lower16:.L_MergedGlobals
+;CHECK-WIN32: movt [[REG1]], :upper16:.L_MergedGlobals
store i32 %a1, i32* @x, align 4
store i32 %a2, i32* @y, align 4
ret void
@@ -21,10 +25,13 @@ define void @f1(i32 %a1, i32 %a2) {
define void @g1(i32 %a1, i32 %a2) {
;CHECK: g1:
-;CHECK: ldr {{r[0-9]+}}, [[LABEL2:\.LCPI[0-9]+_[0-9]]]
+;CHECK: ldr {{r[0-9]+}}, [[LABEL2:\.?LCPI[0-9]+_[0-9]]]
;CHECK: [[LABEL2]]:
;CHECK-MERGE: .long .L_MergedGlobals
;CHECK-NO-MERGE: .long {{_?y}}
+;CHECK-WIN32: g1:
+;CHECK-WIN32: movw [[REG2:r[0-9]+]], :lower16:.L_MergedGlobals
+;CHECK-WIN32: movt [[REG2]], :upper16:.L_MergedGlobals
store i32 %a1, i32* @y, align 4
store i32 %a2, i32* @z, align 4
ret void
@@ -35,6 +42,7 @@ define void @g1(i32 %a1, i32 %a2) {
;CHECK-MERGE: .type .L_MergedGlobals,%object
;CHECK-MERGE: .local .L_MergedGlobals
;CHECK-MERGE: .comm .L_MergedGlobals,12,4
+;CHECK-WIN32: .lcomm .L_MergedGlobals,12,4
;CHECK-MERGE: .globl x
;CHECK-MERGE: x = .L_MergedGlobals
@@ -45,3 +53,10 @@ define void @g1(i32 %a1, i32 %a2) {
;CHECK-MERGE: .globl z
;CHECK-MERGE: z = .L_MergedGlobals+8
;CHECK-MERGE: .size z, 4
+
+;CHECK-WIN32: .globl x
+;CHECK-WIN32: x = .L_MergedGlobals
+;CHECK-WIN32: .globl y
+;CHECK-WIN32: y = .L_MergedGlobals+4
+;CHECK-WIN32: .globl z
+;CHECK-WIN32: z = .L_MergedGlobals+8
More information about the llvm-branch-commits
mailing list