• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -mergefunc -S < %s | FileCheck %s
2define i1 @cmp_with_range(i8*, i8*) {
3  %v1 = load i8, i8* %0, !range !0
4  %v2 = load i8, i8* %1, !range !0
5  %out = icmp eq i8 %v1, %v2
6  ret i1 %out
7}
8
9define i1 @cmp_no_range(i8*, i8*) {
10; CHECK-LABEL: @cmp_no_range
11; CHECK-NEXT: %v1 = load i8, i8* %0
12; CHECK-NEXT:  %v2 = load i8, i8* %1
13; CHECK-NEXT:  %out = icmp eq i8 %v1, %v2
14; CHECK-NEXT:  ret i1 %out
15  %v1 = load i8, i8* %0
16  %v2 = load i8, i8* %1
17  %out = icmp eq i8 %v1, %v2
18  ret i1 %out
19}
20
21define i1 @cmp_different_range(i8*, i8*) {
22; CHECK-LABEL: @cmp_different_range
23; CHECK-NEXT:  %v1 = load i8, i8* %0, !range !1
24; CHECK-NEXT:  %v2 = load i8, i8* %1, !range !1
25; CHECK-NEXT:  %out = icmp eq i8 %v1, %v2
26; CHECK-NEXT:  ret i1 %out
27  %v1 = load i8, i8* %0, !range !1
28  %v2 = load i8, i8* %1, !range !1
29  %out = icmp eq i8 %v1, %v2
30  ret i1 %out
31}
32
33define i1 @cmp_with_same_range(i8*, i8*) {
34; CHECK-LABEL: @cmp_with_same_range
35; CHECK: tail call i1 @cmp_with_range
36  %v1 = load i8, i8* %0, !range !0
37  %v2 = load i8, i8* %1, !range !0
38  %out = icmp eq i8 %v1, %v2
39  ret i1 %out
40}
41
42!0 = !{i8 0, i8 2}
43!1 = !{i8 5, i8 7}
44