Home | History | Annotate | Download | only in SpeculativeExecution
      1 ; RUN: opt < %s -S -speculative-execution \
      2 ; RUN:   -spec-exec-max-speculation-cost 4 -spec-exec-max-not-hoisted 3 \
      3 ; RUN:   | FileCheck %s
      4 
      5 declare float @llvm.fabs.f32(float) nounwind readnone
      6 declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
      7 
      8 declare float @unknown(float)
      9 declare float @unknown_readnone(float) nounwind readnone
     10 
     11 ; CHECK-LABEL: @ifThen_fabs(
     12 ; CHECK: call float @llvm.fabs.f32(
     13 ; CHECK: br i1 true
     14 define void @ifThen_fabs() {
     15   br i1 true, label %a, label %b
     16 
     17 a:
     18   %x = call float @llvm.fabs.f32(float 1.0)
     19   br label %b
     20 
     21 b:
     22   ret void
     23 }
     24 
     25 ; CHECK-LABEL: @ifThen_ctlz(
     26 ; CHECK: call i32 @llvm.ctlz.i32(
     27 ; CHECK: br i1 true
     28 define void @ifThen_ctlz() {
     29   br i1 true, label %a, label %b
     30 
     31 a:
     32   %x = call i32 @llvm.ctlz.i32(i32 0, i1 true)
     33   br label %b
     34 
     35 b:
     36   ret void
     37 }
     38 
     39 ; CHECK-LABEL: @ifThen_call_sideeffects(
     40 ; CHECK: br i1 true
     41 ; CHECK: call float @unknown(
     42 define void @ifThen_call_sideeffects() {
     43   br i1 true, label %a, label %b
     44 
     45 a:
     46   %x = call float @unknown(float 1.0)
     47   br label %b
     48 
     49 b:
     50   ret void
     51 }
     52 
     53 ; CHECK-LABEL: @ifThen_call_readnone(
     54 ; CHECK: br i1 true
     55 ; CHECK: call float @unknown_readnone(
     56 define void @ifThen_call_readnone() {
     57   br i1 true, label %a, label %b
     58 a:
     59   %x = call float @unknown_readnone(float 1.0)
     60   br label %b
     61 
     62 b:
     63   ret void
     64 }
     65