xref: /llvm-project/llvm/test/CodeGen/NVPTX/speculative-execution-divergent-target.ll (revision 6e56c35d1959295289734baf8924d477f770d6f8)
1; Checks that speculative-execution only runs on divergent targets, if you pass
2; -spec-exec-only-if-divergent-target.
3
4; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -passes=speculative-execution | \
5; RUN:   FileCheck --check-prefix=ON %s
6; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -passes=speculative-execution \
7; RUN:   -spec-exec-only-if-divergent-target | \
8; RUN:   FileCheck --check-prefix=ON %s
9; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda \
10; RUN:   -passes='speculative-execution<only-if-divergent-target>' | \
11; RUN:   FileCheck --check-prefix=ON %s
12; RUN: opt < %s -S -passes=speculative-execution -spec-exec-only-if-divergent-target | \
13; RUN:   FileCheck --check-prefix=OFF %s
14; RUN: opt < %s -S -passes='speculative-execution<only-if-divergent-target>' | \
15; RUN:   FileCheck --check-prefix=OFF %s
16
17; Hoist in if-then pattern.
18define void @f() {
19; ON: %x = add i32 2, 3
20; ON: br i1 true
21; OFF: br i1 true
22; OFF: %x = add i32 2, 3
23  br i1 true, label %a, label %b
24a:
25  %x = add i32 2, 3
26  br label %b
27b:
28  ret void
29}
30