2015-08-31 15:51:36 +08:00
|
|
|
# RUN: llc -o - %s -start-after=if-converter | FileCheck %s
|
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "E-m:e-i64:64-n32:64"
|
|
|
|
target triple = "powerpc64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
%struct.rwlock_t.0.22.58.68.242.244 = type {}
|
|
|
|
|
|
|
|
@tasklist_lock = external global %struct.rwlock_t.0.22.58.68.242.244, align 1
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
define void @mm_update_next_owner(i8** %p1, i32* %p2) #0 {
|
|
|
|
entry:
|
|
|
|
%0 = load i8*, i8** %p1, align 8
|
|
|
|
br i1 undef, label %do.body.92, label %for.body.21
|
|
|
|
|
|
|
|
for.body.21: ; preds = %entry
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
do.body.92: ; preds = %entry
|
|
|
|
%usage = getelementptr inbounds i8, i8* %0, i64 -48
|
|
|
|
%counter.i = bitcast i8* %usage to i32*
|
|
|
|
%call95 = tail call signext i32 bitcast (i32 (...)* @__raw_read_unlock to i32 (%struct.rwlock_t.0.22.58.68.242.244*)*)(%struct.rwlock_t.0.22.58.68.242.244* nonnull @tasklist_lock) #1
|
|
|
|
store volatile i32 0, i32* %p2, align 4
|
|
|
|
tail call void asm sideeffect "#compiler barrier", "~{memory}"() #1
|
|
|
|
%1 = tail call i32 asm sideeffect "\0Alwsync \0A1:\09lwarx\09$0,0,$1\09\09# atomic_dec_return\0A\09addic\09$0,$0,-1\0A\09stwcx.\09$0,0,$1\0A\09bne-\091b\0Async \0A", "=&r,r,~{cc},~{xer},~{memory}"(i32* %counter.i) #1
|
|
|
|
%cmp.i = icmp eq i32 %1, 0
|
|
|
|
br i1 %cmp.i, label %if.then.i, label %put_task_struct.exit
|
|
|
|
|
|
|
|
if.then.i: ; preds = %do.body.92
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
put_task_struct.exit: ; preds = %do.body.92
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare signext i32 @__raw_read_unlock(...)
|
|
|
|
|
|
|
|
attributes #0 = { nounwind "target-cpu"="pwr7" }
|
|
|
|
attributes #1 = { nounwind }
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: mm_update_next_owner
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2015-08-31 15:51:36 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$x3' }
|
|
|
|
- { reg: '$x4' }
|
2015-08-31 15:51:36 +08:00
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: false
|
|
|
|
isReturnAddressTaken: false
|
|
|
|
hasStackMap: false
|
|
|
|
hasPatchPoint: false
|
|
|
|
stackSize: 144
|
|
|
|
offsetAdjustment: 0
|
|
|
|
maxAlignment: 0
|
|
|
|
adjustsStack: true
|
|
|
|
hasCalls: true
|
|
|
|
maxCallFrameSize: 112
|
|
|
|
hasOpaqueSPAdjustment: false
|
|
|
|
hasVAStart: false
|
|
|
|
hasMustTailInVarArgFunc: false
|
|
|
|
fixedStack:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$x30' }
|
|
|
|
- { id: 1, type: spill-slot, offset: -24, size: 8, alignment: 8, callee-saved-register: '$x29' }
|
2015-08-31 15:51:36 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $x3, $x4, $x29, $x30, $x29, $x30
|
2015-08-31 15:51:36 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
$x0 = MFLR8 implicit $lr8
|
|
|
|
STD $x0, 16, $x1
|
|
|
|
$x1 = STDU $x1, -144, $x1
|
2021-05-20 10:25:51 +08:00
|
|
|
STD killed $x29, 120, $x1 :: (store (s64) into %fixed-stack.1)
|
|
|
|
STD killed $x30, 128, $x1 :: (store (s64) into %fixed-stack.0, align 16)
|
2018-02-01 06:04:26 +08:00
|
|
|
$x30 = OR8 $x4, $x4
|
2021-05-20 10:25:51 +08:00
|
|
|
$x3 = LD 0, killed $x3 :: (load (s64) from %ir.p1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$x29 = ADDI8 killed $x3, -48
|
2019-07-23 03:55:33 +08:00
|
|
|
$x3 = ADDIStocHA8 $x2, @tasklist_lock
|
2021-05-20 10:25:51 +08:00
|
|
|
$x3 = LDtocL @tasklist_lock, killed $x3, implicit $x2 :: (load (s64) from got)
|
2020-04-07 21:57:56 +08:00
|
|
|
BL8_NOP @__raw_read_unlock, csr_ppc64_altivec, implicit-def $lr8, implicit $rm, implicit $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3
|
2018-02-01 06:04:26 +08:00
|
|
|
$r3 = LI 0
|
2021-05-20 10:25:51 +08:00
|
|
|
STW killed $r3, 0, killed $x30 :: (volatile store (s32) into %ir.p2)
|
2018-01-10 08:56:48 +08:00
|
|
|
INLINEASM &"#compiler barrier", 25
|
2018-02-01 06:04:26 +08:00
|
|
|
INLINEASM &"\0Alwsync \0A1:\09lwarx\09$0,0,$1\09\09# atomic_dec_return\0A\09addic\09$0,$0,-1\0A\09stwcx.\09$0,0,$1\0A\09bne-\091b\0Async \0A", 25, 131083, def early-clobber $r3, 851977, killed $x29, 12, implicit-def dead early-clobber $cr0
|
2015-08-31 15:51:36 +08:00
|
|
|
; CHECK-LABEL: @mm_update_next_owner
|
|
|
|
; CHECK-NOT: lwarx 29, 0, 29
|
|
|
|
; CHECK-NOT: stwcx. 29, 0, 29
|
2018-02-01 06:04:26 +08:00
|
|
|
$cr0 = CMPLWI killed $r3, 0
|
2021-05-20 10:25:51 +08:00
|
|
|
$x30 = LD 128, $x1 :: (load (s64) from %fixed-stack.0, align 16)
|
|
|
|
$x29 = LD 120, $x1 :: (load (s64) from %fixed-stack.1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$x1 = ADDI8 $x1, 144
|
|
|
|
$x0 = LD 16, $x1
|
|
|
|
MTLR8 $x0, implicit-def $lr8
|
|
|
|
BLR8 implicit $lr8, implicit $rm
|
2015-08-31 15:51:36 +08:00
|
|
|
|
|
|
|
...
|