• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -mtriple=powerpc64-linux-gnu -mcpu=pwr8 -mattr=+vsx -slp-vectorizer < %s | FileCheck %s
3
4%struct.A = type { i8*, i8* }
5
6define i64 @foo(%struct.A* nocapture readonly %this) {
7; CHECK-LABEL: @foo(
8; CHECK-NEXT:  entry:
9; CHECK-NEXT:    [[END_I:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[THIS:%.*]], i64 0, i32 1
10; CHECK-NEXT:    [[TMP0:%.*]] = bitcast i8** [[END_I]] to i64*
11; CHECK-NEXT:    [[TMP1:%.*]] = load i64, i64* [[TMP0]], align 8
12; CHECK-NEXT:    [[TMP2:%.*]] = bitcast %struct.A* [[THIS]] to i64*
13; CHECK-NEXT:    [[TMP3:%.*]] = load i64, i64* [[TMP2]], align 8
14; CHECK-NEXT:    [[SUB_PTR_SUB_I:%.*]] = sub i64 [[TMP1]], [[TMP3]]
15; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i64 [[SUB_PTR_SUB_I]], 9
16; CHECK-NEXT:    br i1 [[CMP]], label [[RETURN:%.*]], label [[LOR_LHS_FALSE:%.*]]
17; CHECK:       lor.lhs.false:
18; CHECK-NEXT:    [[TMP4:%.*]] = inttoptr i64 [[TMP3]] to i8*
19; CHECK-NEXT:    [[TMP5:%.*]] = inttoptr i64 [[TMP1]] to i8*
20; CHECK-NEXT:    [[CMP2:%.*]] = icmp ugt i8* [[TMP5]], [[TMP4]]
21; CHECK-NEXT:    [[DOT:%.*]] = select i1 [[CMP2]], i64 2, i64 -1
22; CHECK-NEXT:    ret i64 [[DOT]]
23; CHECK:       return:
24; CHECK-NEXT:    ret i64 2
25;
26entry:
27  %end.i = getelementptr inbounds %struct.A, %struct.A* %this, i64 0, i32 1
28  %0 = bitcast i8** %end.i to i64*
29  %1 = load i64, i64* %0, align 8
30  %2 = bitcast %struct.A* %this to i64*
31  %3 = load i64, i64* %2, align 8
32  %sub.ptr.sub.i = sub i64 %1, %3
33  %cmp = icmp sgt i64 %sub.ptr.sub.i, 9
34  br i1 %cmp, label %return, label %lor.lhs.false
35
36lor.lhs.false:
37  %4 = inttoptr i64 %3 to i8*
38  %5 = inttoptr i64 %1 to i8*
39  %cmp2 = icmp ugt i8* %5, %4
40  %. = select i1 %cmp2, i64 2, i64 -1
41  ret i64 %.
42
43return:
44  ret i64 2
45}
46
47