[WebAssembly] Remove uses of ThreadModel
Summary:
In the clang UI, replaces -mthread-model posix with -matomics as the
source of truth on threading. In the backend, replaces
-thread-model=posix with the atomics target feature, which is now
collected on the WebAssemblyTargetMachine along with all other used
features. These collected features will also be used to emit the
target features section in the future.
The default configuration for the backend is thread-model=posix and no
atomics, which was previously an invalid configuration. This change
makes the default valid because the thread model is ignored.
A side effect of this change is that objects are never emitted with
passive segments. It will instead be up to the linker to decide
whether sections should be active or passive based on whether atomics
are used in the final link.
Reviewers: aheejin, sbc100, dschuff
Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D58742
llvm-svn: 355112
2019-03-01 02:39:08 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o - | obj2yaml | FileCheck %s
|
2018-01-24 07:03:47 +08:00
|
|
|
|
2018-05-11 01:49:11 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2017-09-16 04:54:59 +08:00
|
|
|
|
|
|
|
%struct.bd = type { i32, i8 }
|
|
|
|
|
|
|
|
@global0 = global i32 8, align 8
|
|
|
|
@global1 = global %struct.bd { i32 1, i8 3 }, align 8, section ".sec1"
|
|
|
|
@global2 = global i64 7, align 8, section ".sec1"
|
|
|
|
@global3 = global i32 8, align 8, section ".sec2"
|
|
|
|
|
2018-02-23 13:08:34 +08:00
|
|
|
|
2019-04-13 06:27:48 +08:00
|
|
|
; CHECK: - Type: DATA{{$}}
|
2019-03-06 10:00:22 +08:00
|
|
|
; CHECK-NEXT: Segments:
|
2017-09-16 04:54:59 +08:00
|
|
|
; CHECK-NEXT: - SectionOffset: 6
|
2019-02-20 06:56:19 +08:00
|
|
|
; CHECK-NEXT: InitFlags: 0
|
|
|
|
; CHECK-NEXT: Offset:
|
2017-09-16 04:54:59 +08:00
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 0
|
|
|
|
; CHECK-NEXT: Content: '08000000'
|
|
|
|
; CHECK-NEXT: - SectionOffset: 15
|
2019-02-20 06:56:19 +08:00
|
|
|
; CHECK-NEXT: InitFlags: 0
|
|
|
|
; CHECK-NEXT: Offset:
|
2017-09-16 04:54:59 +08:00
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 8
|
|
|
|
; CHECK-NEXT: Content: '01000000030000000700000000000000'
|
|
|
|
; CHECK-NEXT: - SectionOffset: 36
|
2019-02-20 06:56:19 +08:00
|
|
|
; CHECK-NEXT: InitFlags: 0
|
|
|
|
; CHECK-NEXT: Offset:
|
2017-09-16 04:54:59 +08:00
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 24
|
|
|
|
; CHECK-NEXT: Content: '08000000'
|
2018-04-27 02:15:32 +08:00
|
|
|
|
|
|
|
; CHECK: SymbolTable:
|
2018-02-23 13:08:34 +08:00
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Kind: DATA
|
|
|
|
; CHECK-NEXT: Name: global0
|
|
|
|
; CHECK-NEXT: Flags: [ ]
|
|
|
|
; CHECK-NEXT: Segment: 0
|
|
|
|
; CHECK-NEXT: Size: 4
|
|
|
|
; CHECK-NEXT: - Index: 1
|
|
|
|
; CHECK-NEXT: Kind: DATA
|
|
|
|
; CHECK-NEXT: Name: global1
|
|
|
|
; CHECK-NEXT: Flags: [ ]
|
|
|
|
; CHECK-NEXT: Segment: 1
|
|
|
|
; CHECK-NEXT: Size: 8
|
|
|
|
; CHECK-NEXT: - Index: 2
|
|
|
|
; CHECK-NEXT: Kind: DATA
|
|
|
|
; CHECK-NEXT: Name: global2
|
|
|
|
; CHECK-NEXT: Flags: [ ]
|
|
|
|
; CHECK-NEXT: Segment: 1
|
|
|
|
; CHECK-NEXT: Offset: 8
|
|
|
|
; CHECK-NEXT: Size: 8
|
|
|
|
; CHECK-NEXT: - Index: 3
|
|
|
|
; CHECK-NEXT: Kind: DATA
|
|
|
|
; CHECK-NEXT: Name: global3
|
|
|
|
; CHECK-NEXT: Flags: [ ]
|
|
|
|
; CHECK-NEXT: Segment: 2
|
|
|
|
; CHECK-NEXT: Size: 4
|
2019-03-06 10:00:22 +08:00
|
|
|
; CHECK-NEXT: SegmentInfo:
|
2017-09-21 03:03:35 +08:00
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Name: .data.global0
|
2019-01-16 09:34:48 +08:00
|
|
|
; CHECK-NEXT: Alignment: 3
|
2017-12-14 06:02:25 +08:00
|
|
|
; CHECK-NEXT: Flags: [ ]
|
2017-09-21 03:03:35 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
|
|
|
; CHECK-NEXT: Name: .sec1
|
2019-01-16 09:34:48 +08:00
|
|
|
; CHECK-NEXT: Alignment: 3
|
2017-12-14 06:02:25 +08:00
|
|
|
; CHECK-NEXT: Flags: [ ]
|
2017-09-21 03:03:35 +08:00
|
|
|
; CHECK-NEXT: - Index: 2
|
|
|
|
; CHECK-NEXT: Name: .sec2
|
2019-01-16 09:34:48 +08:00
|
|
|
; CHECK-NEXT: Alignment: 3
|
2017-12-14 06:02:25 +08:00
|
|
|
; CHECK-NEXT: Flags: [ ]
|
2017-09-21 03:03:35 +08:00
|
|
|
; CHECK-NEXT: ...
|