Justin Lebar | f04e678 | 2016-04-15 01:20:52 +0000 | [diff] [blame] | 1 | ; Checks that speculative-execution only runs on divergent targets, if you pass |
| 2 | ; -spec-exec-only-if-divergent-target. |
| 3 | |
Justin Lebar | cad81cf | 2016-04-15 00:32:09 +0000 | [diff] [blame] | 4 | ; 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 Lebar | f04e678 | 2016-04-15 01:20:52 +0000 | [diff] [blame] | 9 | ; RUN: opt < %s -S -speculative-execution -spec-exec-only-if-divergent-target | \ |
Justin Lebar | cad81cf | 2016-04-15 00:32:09 +0000 | [diff] [blame] | 10 | ; RUN: FileCheck --check-prefix=OFF %s |
| 11 | |
| 12 | ; Hoist in if-then pattern. |
| 13 | define 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 |
| 19 | a: |
| 20 | %x = add i32 2, 3 |
| 21 | br label %b |
| 22 | b: |
| 23 | ret void |
| 24 | } |