1*9880d681SAndroid Build Coastguard Worker; Checks that speculative-execution only runs on divergent targets, if you pass 2*9880d681SAndroid Build Coastguard Worker; -spec-exec-only-if-divergent-target. 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution | \ 5*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck --check-prefix=ON %s 6*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -speculative-execution \ 7*9880d681SAndroid Build Coastguard Worker; RUN: -spec-exec-only-if-divergent-target | \ 8*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck --check-prefix=ON %s 9*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -S -speculative-execution -spec-exec-only-if-divergent-target | \ 10*9880d681SAndroid Build Coastguard Worker; RUN: FileCheck --check-prefix=OFF %s 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Worker; Hoist in if-then pattern. 13*9880d681SAndroid Build Coastguard Workerdefine void @f() { 14*9880d681SAndroid Build Coastguard Worker; ON: %x = add i32 2, 3 15*9880d681SAndroid Build Coastguard Worker; ON: br i1 true 16*9880d681SAndroid Build Coastguard Worker; OFF: br i1 true 17*9880d681SAndroid Build Coastguard Worker; OFF: %x = add i32 2, 3 18*9880d681SAndroid Build Coastguard Worker br i1 true, label %a, label %b 19*9880d681SAndroid Build Coastguard Workera: 20*9880d681SAndroid Build Coastguard Worker %x = add i32 2, 3 21*9880d681SAndroid Build Coastguard Worker br label %b 22*9880d681SAndroid Build Coastguard Workerb: 23*9880d681SAndroid Build Coastguard Worker ret void 24*9880d681SAndroid Build Coastguard Worker} 25