File: remove-attributes-convergent-uncontrolled.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.4-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,236,516 kB
  • sloc: cpp: 7,619,569; ansic: 1,433,956; asm: 1,058,748; python: 252,181; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,585; awk: 3,523; javascript: 2,272; xml: 892; fortran: 770
file content (31 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (7)
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
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=attributes --test FileCheck --test-arg --check-prefix=INTERESTING --test-arg %s --test-arg --input-file %s -o %t
; RUN: FileCheck --check-prefixes=RESULT %s < %t

; Test that convergent attributes are reduced if convergencectrl
; bundles are not used

; INTERESTING-LABEL: define float @convergent_intrinsic(
; RESULT-LABEL: define float @convergent_intrinsic(float %x, float %y) {
define float @convergent_intrinsic(float %x, float %y) #0 {
  %val = call float @llvm.amdgcn.readfirstlane.f32(float %x)
  ret float %val
}

; INTERESTING-LABEL: define float @convergent_func_no_convergent_intrinsics(
; RESULT-LABEL: define float @convergent_func_no_convergent_intrinsics(float %x, float %y) {
define float @convergent_func_no_convergent_intrinsics(float %x, float %y) #0 {
  %val = call float @extern.func(float %x, float %y)
  ret float %val
}


; RESULT-LABEL: declare float @convergent.extern.func(float, float){{$}}
declare float @convergent.extern.func(float, float) #0
declare float @extern.func(float, float)
declare float @llvm.amdgcn.readfirstlane.f32(float) #1

; RESULT: attributes #0 = { convergent nocallback nofree nounwind willreturn memory(none) }
; RESULT-NOT: attributes

attributes #0 = { convergent nounwind }
attributes #1 = { convergent nocallback nofree nounwind willreturn memory(none) }