summaryrefslogtreecommitdiffstats
path: root/llvm/test/Feature/OperandBundles/basic-aa-argmemonly.ll
blob: 1f3b378868e7a0add301d1cf4dcb9507b6f74b87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: opt -S -basicaa -gvn < %s | FileCheck %s

declare void @argmemonly_function(i32 *) argmemonly

define i32 @test0(i32* %P, i32* noalias %P2) {
; CHECK-LABEL: @test0(
  %v1 = load i32, i32* %P
; CHECK: %v1 = load i32, i32* %P
  call void @argmemonly_function(i32* %P2) [ "tag"() ]
; CHECK: call void @argmemonly_function(
  %v2 = load i32, i32* %P
; CHECK: %v2 = load i32, i32* %P
  %diff = sub i32 %v1, %v2
; CHECK: %diff = sub i32 %v1, %v2
  ret i32 %diff
; CHECK: ret i32 %diff
}

define i32 @test1(i32* %P, i32* noalias %P2) {
; CHECK-LABEL: @test1(
  %v1 = load i32, i32* %P
  call void @argmemonly_function(i32* %P2) argmemonly [ "tag"() ]
; CHECK: call void @argmemonly_function(
  %v2 = load i32, i32* %P
  %diff = sub i32 %v1, %v2
  ret i32 %diff
; CHECK: ret i32 0
}
OpenPOWER on IntegriCloud