[DSE,MSSA] Add additional tests with non-removable stores (NFC).

Add a few additional tests with volatile stores, which cannot be
removedt stas.
This commit is contained in:
Florian Hahn 2020-06-22 16:09:03 +01:00
parent 3a84d84adc
commit b458d8ce95
1 changed files with 51 additions and 0 deletions

View File

@ -610,3 +610,54 @@ entry:
store atomic i8 3, i8* %P2 unordered, align 4
ret void
}
; Some tests where volatile may block removing a store.
define void @test44_volatile(i32* %P) {
; CHECK-LABEL: @test44_volatile(
; CHECK-NEXT: store i32 1, i32* [[P:%.*]], align 4
; CHECK-NEXT: store volatile i32 2, i32* [[P]], align 4
; CHECK-NEXT: store i32 3, i32* [[P]], align 4
; CHECK-NEXT: ret void
;
store i32 1, i32* %P, align 4
store volatile i32 2, i32* %P, align 4
store i32 3, i32* %P, align 4
ret void
}
define void @test45_volatile(i32* %P) {
; CHECK-LABEL: @test45_volatile(
; CHECK-NEXT: store i32 1, i32* [[P:%.*]], align 4
; CHECK-NEXT: store volatile i32 2, i32* [[P]], align 4
; CHECK-NEXT: store volatile i32 3, i32* [[P]], align 4
; CHECK-NEXT: ret void
;
store i32 1, i32* %P, align 4
store volatile i32 2, i32* %P, align 4
store volatile i32 3, i32* %P, align 4
ret void
}
define void @test46_volatile(i32* %P) {
; CHECK-LABEL: @test46_volatile(
; CHECK-NEXT: store volatile i32 2, i32* [[P:%.*]], align 4
; CHECK-NEXT: store i32 1, i32* [[P]], align 4
; CHECK-NEXT: store volatile i32 3, i32* [[P]], align 4
; CHECK-NEXT: ret void
;
store volatile i32 2, i32* %P, align 4
store i32 1, i32* %P, align 4
store volatile i32 3, i32* %P, align 4
ret void
}
define void @test47_volatile(i32* %P) {
; CHECK-LABEL: @test47_volatile(
; CHECK-NEXT: store volatile i32 2, i32* [[P:%.*]], align 4
; CHECK-NEXT: store volatile i32 3, i32* [[P]], align 4
; CHECK-NEXT: ret void
;
store volatile i32 2, i32* %P, align 4
store volatile i32 3, i32* %P, align 4
ret void
}