File: remove-incompatible-extended-image-insts.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (48 lines) | stat: -rw-r--r-- 2,434 bytes parent folder | download | duplicates (6)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=amdgcn -mcpu=gfx908 -stop-after=amdgpu-remove-incompatible-functions\
; RUN:   -pass-remarks=amdgpu-remove-incompatible-functions %s -o - 2>%t | FileCheck -check-prefix=EXTIMG %s
; RUN: FileCheck -allow-empty --check-prefix=WARN-EXTIMG %s < %t
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s

; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -stop-after=amdgpu-remove-incompatible-functions\
; RUN:   -pass-remarks=amdgpu-remove-incompatible-functions %s -o - 2>%t | FileCheck -check-prefix=NOEXTIMG %s
; RUN: FileCheck --check-prefix=WARN-NOEXTIMG %s < %t
; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs < %s

; Note: This test checks the IR, but also has a run line to codegen the file just to check we
; do not crash when trying to select those functions.

; WARN-EXTIMG-NOT: removing function 'needs_extimg':
; WARN-NOEXTIMG:   removing function 'needs_extimg': +extended-image-insts is not supported on the current target

; EXTIMG:       @GVRefs {{.*}} [ptr @needs_extimg]
; NOEXTIMG:     @GVRefs {{.*}} zeroinitializer
@GVRefs = internal global [1 x ptr] [
  ptr @needs_extimg
]

; EXTIMG:         @ConstantExpr = internal global i64 ptrtoint (ptr @needs_extimg to i64)
; NOEXTIMG:       @ConstantExpr = internal global i64 0

@ConstantExpr = internal global i64 ptrtoint (ptr @needs_extimg to i64)

; EXTIMG:         define <4 x float> @needs_extimg
; NOEXTIMG-NOT:   define <4 x float> @needs_extimg
define <4 x float> @needs_extimg(float noundef %0, float noundef %1, <8 x i32> noundef %2, <4 x i32> noundef %3) #0 {
  %5 = tail call <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32 noundef 15, float %0, float %1, <8 x i32> %2, <4 x i32> %3, i1 noundef false, i32 noundef 0, i32 noundef 0)
  ret <4 x float> %5
}

; IR: define void @caller(
define void @caller(float noundef %0, float noundef %1, <8 x i32> noundef %2, <4 x i32> noundef %3) {
  call void @needs_extimg(float %0, float %1, <8 x i32> %2, <4 x i32> %3)
  ; IR: ret void
  ret void
}

declare <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32 immarg, float, float, <8 x i32>, <4 x i32>, i1 immarg, i32 immarg, i32 immarg)

attributes #0 = { "target-features"="+extended-image-insts" }
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; EXTIMG: {{.*}}
; NOEXTIMG: {{.*}}