File: icv_tracking_out_of_scope.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (53 lines) | stat: -rw-r--r-- 1,619 bytes parent folder | download | duplicates (4)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt -S -openmp-opt-cgscc < %s | FileCheck %s
; 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, i32* @inofth, align 4
; CHECK-NEXT:    call void @omp_set_num_threads(i32 noundef [[TMP0]])
; CHECK-NEXT:    ret void
;
entry:
  %0 = load i32, i32* @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}