File: icv_tracking_out_of_scope.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 (52 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download | duplicates (12)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt -S -passes=openmp-opt-cgscc < %s | FileCheck %s

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

@inofth = external global i32, align 4

define void @set() {
; CHECK-LABEL: define {{[^@]+}}@set() {
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @inofth, align 4
; CHECK-NEXT:    call void @omp_set_num_threads(i32 noundef [[TMP0]])
; CHECK-NEXT:    ret void
;
entry:
  %0 = load i32, ptr @inofth, align 4
  call void @omp_set_num_threads(i32 noundef %0)
  ret void
}

define i32 @test(i32 %a) {
; CHECK-LABEL: define {{[^@]+}}@test
; CHECK-SAME: (i32 [[A:%.*]]) {
; CHECK-NEXT:  entry:
; CHECK-NEXT:    call void @set()
; CHECK-NEXT:    [[CALL:%.*]] = call i32 @omp_get_max_threads()
; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32 [[CALL]], [[A]]
; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK:       if.then:
; CHECK-NEXT:    ret i32 0
; CHECK:       if.end:
; CHECK-NEXT:    ret i32 1
;
entry:
  call void @set()
  %call = call i32 @omp_get_max_threads()
  %cmp = icmp ne i32 %call, %a
  br i1 %cmp, label %if.then, label %if.end

if.then:                                          ; preds = %entry
  ret i32 0

if.end:                                           ; preds = %if.then, %entry
  ret i32 1
}

declare void @omp_set_num_threads(i32 noundef)
declare i32 @omp_get_max_threads()

!llvm.module.flags = !{!0}

!0 = !{i32 7, !"openmp", i32 50}