summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GVNHoist/hoist-pr28933.ll
blob: 95df3f220f281e4844ef9f45e03768eb61ba1943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: opt -S -gvn-hoist -verify-memoryssa < %s | FileCheck %s

; Check that we end up with one load and one store, in the right order
; CHECK-LABEL:  define void @test_it(
; CHECK: store
; CHECK-NEXT: load
; CHECK-NOT: store
; CHECK-NOT: load
        
%rec894.0.1.2.3.12 = type { i16 }

@a = external global %rec894.0.1.2.3.12

define void @test_it() {
bb2:
  store i16 undef, i16* getelementptr inbounds (%rec894.0.1.2.3.12, %rec894.0.1.2.3.12* @a, i16 0, i32 0), align 1
  %_tmp61 = load i16, i16* getelementptr inbounds (%rec894.0.1.2.3.12, %rec894.0.1.2.3.12* @a, i16 0, i32 0), align 1
  store i16 undef, i16* getelementptr inbounds (%rec894.0.1.2.3.12, %rec894.0.1.2.3.12* @a, i16 0, i32 0), align 1
  %_tmp92 = load i16, i16* getelementptr inbounds (%rec894.0.1.2.3.12, %rec894.0.1.2.3.12* @a, i16 0, i32 0), align 1
  ret void
}
OpenPOWER on IntegriCloud