blob: 128e9e9ba2a3deee596c35a6d07814d6e8a2488b [file] [log] [blame]
Justin Lebarf04e6782016-04-15 01:20:52 +00001; Checks that speculative-execution only runs on divergent targets, if you pass
2; -spec-exec-only-if-divergent-target.
3
Justin Lebarcad81cf2016-04-15 00:32:09 +00004; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution | \
5; RUN: FileCheck --check-prefix=ON %s
6; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution \
7; RUN: -spec-exec-only-if-divergent-target | \
8; RUN: FileCheck --check-prefix=ON %s
Justin Lebarf04e6782016-04-15 01:20:52 +00009; RUN: opt < %s -S -speculative-execution -spec-exec-only-if-divergent-target | \
Justin Lebarcad81cf2016-04-15 00:32:09 +000010; RUN: FileCheck --check-prefix=OFF %s
11
12; Hoist in if-then pattern.
13define void @f() {
14; ON: %x = add i32 2, 3
15; ON: br i1 true
16; OFF: br i1 true
17; OFF: %x = add i32 2, 3
18 br i1 true, label %a, label %b
19a:
20 %x = add i32 2, 3
21 br label %b
22b:
23 ret void
24}