Matt Arsenault | ef00283 | 2016-10-28 20:00:33 +0000 | [diff] [blame] | 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 | ; CHECK-LABEL: @ifThen_bitcast( |
| 6 | ; CHECK: bitcast |
| 7 | ; CHECK: br i1 true |
| 8 | define void @ifThen_bitcast() { |
| 9 | br i1 true, label %a, label %b |
| 10 | |
| 11 | a: |
| 12 | %x = bitcast i32 undef to float |
| 13 | br label %b |
| 14 | |
| 15 | b: |
| 16 | ret void |
| 17 | } |
| 18 | |
| 19 | ; CHECK-LABEL: @ifThen_ptrtoint( |
| 20 | ; CHECK: ptrtoint |
| 21 | ; CHECK: br i1 true |
| 22 | define void @ifThen_ptrtoint() { |
| 23 | br i1 true, label %a, label %b |
| 24 | |
| 25 | a: |
| 26 | %x = ptrtoint i32* undef to i64 |
| 27 | br label %b |
| 28 | |
| 29 | b: |
| 30 | ret void |
| 31 | } |
| 32 | |
| 33 | ; CHECK-LABEL: @ifThen_inttoptr( |
| 34 | ; CHECK: inttoptr |
| 35 | ; CHECK: br i1 true |
| 36 | define void @ifThen_inttoptr() { |
| 37 | br i1 true, label %a, label %b |
| 38 | |
| 39 | a: |
| 40 | %x = inttoptr i64 undef to i32* |
| 41 | br label %b |
| 42 | |
| 43 | b: |
| 44 | ret void |
| 45 | } |
| 46 | |
| 47 | ; CHECK-LABEL: @ifThen_addrspacecast( |
| 48 | ; CHECK: addrspacecast |
| 49 | ; CHECK: br i1 true |
| 50 | define void @ifThen_addrspacecast() { |
| 51 | br i1 true, label %a, label %b |
| 52 | a: |
| 53 | %x = addrspacecast i32* undef to i32 addrspace(1)* |
| 54 | br label %b |
| 55 | |
| 56 | b: |
| 57 | ret void |
| 58 | } |
| 59 | |
| 60 | ; CHECK-LABEL: @ifThen_fptoui( |
| 61 | ; CHECK: fptoui |
| 62 | ; CHECK: br i1 true |
| 63 | define void @ifThen_fptoui() { |
| 64 | br i1 true, label %a, label %b |
| 65 | a: |
| 66 | %x = fptoui float undef to i32 |
| 67 | br label %b |
| 68 | |
| 69 | b: |
| 70 | ret void |
| 71 | } |
| 72 | |
| 73 | ; CHECK-LABEL: @ifThen_fptosi( |
| 74 | ; CHECK: fptosi |
| 75 | ; CHECK: br i1 true |
| 76 | define void @ifThen_fptosi() { |
| 77 | br i1 true, label %a, label %b |
| 78 | a: |
| 79 | %x = fptosi float undef to i32 |
| 80 | br label %b |
| 81 | |
| 82 | b: |
| 83 | ret void |
| 84 | } |
| 85 | |
| 86 | ; CHECK-LABEL: @ifThen_uitofp( |
| 87 | ; CHECK: uitofp |
| 88 | ; CHECK: br i1 true |
| 89 | define void @ifThen_uitofp() { |
| 90 | br i1 true, label %a, label %b |
| 91 | a: |
| 92 | %x = uitofp i32 undef to float |
| 93 | br label %b |
| 94 | |
| 95 | b: |
| 96 | ret void |
| 97 | } |
| 98 | |
| 99 | ; CHECK-LABEL: @ifThen_sitofp( |
| 100 | ; CHECK: sitofp |
| 101 | ; CHECK: br i1 true |
| 102 | define void @ifThen_sitofp() { |
| 103 | br i1 true, label %a, label %b |
| 104 | a: |
| 105 | %x = sitofp i32 undef to float |
| 106 | br label %b |
| 107 | |
| 108 | b: |
| 109 | ret void |
| 110 | } |
| 111 | |
| 112 | ; CHECK-LABEL: @ifThen_fpext( |
| 113 | ; CHECK: fpext |
| 114 | ; CHECK: br i1 true |
| 115 | define void @ifThen_fpext() { |
| 116 | br i1 true, label %a, label %b |
| 117 | a: |
| 118 | %x = fpext float undef to double |
| 119 | br label %b |
| 120 | |
| 121 | b: |
| 122 | ret void |
| 123 | } |
| 124 | |
| 125 | ; CHECK-LABEL: @ifThen_fptrunc( |
| 126 | ; CHECK: fptrunc |
| 127 | ; CHECK: br i1 true |
| 128 | define void @ifThen_fptrunc() { |
| 129 | br i1 true, label %a, label %b |
| 130 | a: |
| 131 | %x = fptrunc double undef to float |
| 132 | br label %b |
| 133 | |
| 134 | b: |
| 135 | ret void |
| 136 | } |