File: select-dependence.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 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 (41 lines) | stat: -rw-r--r-- 1,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
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes='print<access-info>' -disable-output 2>&1 < %s | FileCheck %s

define void @test(ptr noalias %x, ptr noalias %y, ptr noalias %z) {
; CHECK-LABEL: 'test'
; CHECK-NEXT:    loop:
; CHECK-NEXT:      Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
; CHECK-NEXT:  Unsafe indirect dependence.
; CHECK-NEXT:      Dependences:
; CHECK-NEXT:        IndirectUnsafe:
; CHECK-NEXT:            %load = load double, ptr %gep.sel, align 8 ->
; CHECK-NEXT:            store double %load, ptr %gep.sel2, align 8
; CHECK-EMPTY:
; CHECK-NEXT:      Run-time memory checks:
; CHECK-NEXT:      Grouped accesses:
; CHECK-EMPTY:
; CHECK-NEXT:      Non vectorizable stores to invariant address were not found in loop.
; CHECK-NEXT:      SCEV assumptions:
; CHECK-EMPTY:
; CHECK-NEXT:      Expressions re-written:
;
entry:
   %gep.y = getelementptr double, ptr %y, i64 -32
   br label %loop

loop:
   %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]
   %icmp = icmp ule i64 %iv, 32
   %sel = select i1 %icmp, ptr %x, ptr %gep.y
   %gep.sel = getelementptr inbounds double, ptr %sel, i64 %iv
   %load = load double, ptr %gep.sel, align 8
   %sel2 = select i1 %icmp, ptr %y, ptr %z
   %gep.sel2 = getelementptr inbounds double, ptr %sel2, i64 %iv
   store double %load, ptr %gep.sel2, align 8
   %iv.next = add nuw nsw i64 %iv, 1
   %exit.cond = icmp eq i64 %iv, 94
   br i1 %exit.cond, label %exit, label %loop

exit:
   ret void
}