File: geps-ptrvector.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (59 lines) | stat: -rw-r--r-- 2,668 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s

; Should not crash when GEP pointer operand is a vector.
define <2 x i1> @test.vectorgep(<2 x ptr> %vec) {
; CHECK-LABEL: @test.vectorgep(
; CHECK-NEXT:    [[GEP:%.*]] = getelementptr inbounds i32, <2 x ptr> [[VEC:%.*]], i64 0
; CHECK-NEXT:    [[COND:%.*]] = icmp ule <2 x ptr> [[GEP]], zeroinitializer
; CHECK-NEXT:    ret <2 x i1> [[COND]]
;
  %gep = getelementptr inbounds i32, <2 x ptr> %vec, i64 0
  %cond = icmp ule <2 x ptr> %gep, zeroinitializer
  ret <2 x i1> %cond
}

define <2 x i1> @test.vectorgep.ult.true(<2 x ptr> %vec) {
; CHECK-LABEL: @test.vectorgep.ult.true(
; CHECK-NEXT:    [[GEP_1:%.*]] = getelementptr inbounds i32, <2 x ptr> [[VEC:%.*]], i64 1
; CHECK-NEXT:    [[T_1:%.*]] = icmp ult <2 x ptr> [[VEC]], [[GEP_1]]
; CHECK-NEXT:    ret <2 x i1> <i1 true, i1 true>
;
  %gep.1 = getelementptr inbounds i32, <2 x ptr> %vec, i64 1
  %t.1 = icmp ult <2 x ptr> %vec, %gep.1
  ret <2 x i1> %t.1
}

define <2 x i1> @test.vectorgep.ult.false(<2 x ptr> %vec) {
; CHECK-LABEL: @test.vectorgep.ult.false(
; CHECK-NEXT:    [[GEP_1:%.*]] = getelementptr inbounds i32, <2 x ptr> [[VEC:%.*]], i64 1
; CHECK-NEXT:    [[T_1:%.*]] = icmp ult <2 x ptr> [[GEP_1]], [[VEC]]
; CHECK-NEXT:    ret <2 x i1> zeroinitializer
;
  %gep.1 = getelementptr inbounds i32, <2 x ptr> %vec, i64 1
  %t.1 = icmp ult <2 x ptr> %gep.1, %vec
  ret <2 x i1> %t.1
}


define <vscale x 2 x i1> @test.scalable.vectorgep.ult.true(<vscale x 2 x ptr> %vec) {
; CHECK-LABEL: @test.scalable.vectorgep.ult.true(
; CHECK-NEXT:    [[GEP_1:%.*]] = getelementptr inbounds i32, <vscale x 2 x ptr> [[VEC:%.*]], i64 1
; CHECK-NEXT:    [[T_1:%.*]] = icmp ult <vscale x 2 x ptr> [[VEC]], [[GEP_1]]
; CHECK-NEXT:    ret <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer)
;
  %gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
  %t.1 = icmp ult <vscale x 2 x ptr> %vec, %gep.1
  ret <vscale x 2 x i1> %t.1
}

define <vscale x 2 x i1> @test.scalable.vectorgep.ult.false(<vscale x 2 x ptr> %vec) {
; CHECK-LABEL: @test.scalable.vectorgep.ult.false(
; CHECK-NEXT:    [[GEP_1:%.*]] = getelementptr inbounds i32, <vscale x 2 x ptr> [[VEC:%.*]], i64 1
; CHECK-NEXT:    [[T_1:%.*]] = icmp ult <vscale x 2 x ptr> [[GEP_1]], [[VEC]]
; CHECK-NEXT:    ret <vscale x 2 x i1> zeroinitializer
;
  %gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
  %t.1 = icmp ult <vscale x 2 x ptr> %gep.1, %vec
  ret <vscale x 2 x i1> %t.1
}