File: geps-ptrvector.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; 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
}