brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · 6c5cbab Raw
119 lines · plain
1; RUN: llc -o - %s -asm-verbose=false -wasm-keep-registers -disable-wasm-fallthrough-return-opt -mattr=+simd128 | FileCheck %s2 3target triple = "wasm32-unknown-unknown"4 5; Test that stackified IMPLICIT_DEF instructions are converted into6; CONST_XXX instructions to provide an explicit push.7 8; CHECK-LABEL: implicit_def_i32:9; CHECK:      i32.const $push{{[0-9]+}}=, 0{{$}}10; CHECK:      i32.const $push{{[0-9]+}}=, 0{{$}}11; CHECK:      i32.const $push[[R:[0-9]+]]=, 0{{$}}12; CHECK-NEXT: return $pop[[R]]{{$}}13define i32 @implicit_def_i32() {14  br i1 undef, label %A, label %X15 16A:                                                ; preds = %017  %d = icmp slt i1 0, 018  br i1 %d, label %C, label %B19 20B:                                                ; preds = %A21  br label %C22 23C:                                                ; preds = %B, %A24  %h = phi i32 [ undef, %A ], [ 0, %B ]25  br label %X26 27X:                                                ; preds = %0, C28  %i = phi i32 [ 1, %0 ], [ %h, %C ]29  ret i32 %i30}31 32; CHECK-LABEL: implicit_def_i64:33; CHECK:      i64.const $push[[R:[0-9]+]]=, 0{{$}}34; CHECK-NEXT: return $pop[[R]]{{$}}35define i64 @implicit_def_i64() {36  br i1 undef, label %A, label %X37 38A:                                                ; preds = %039  %d = icmp slt i1 0, 040  br i1 %d, label %C, label %B41 42B:                                                ; preds = %A43  br label %C44 45C:                                                ; preds = %B, %A46  %h = phi i64 [ undef, %A ], [ 0, %B ]47  br label %X48 49X:                                                ; preds = %0, C50  %i = phi i64 [ 1, %0 ], [ %h, %C ]51  ret i64 %i52}53 54; CHECK-LABEL: implicit_def_f32:55; CHECK:      f32.const $push[[R:[0-9]+]]=, 0x0p0{{$}}56; CHECK-NEXT: return $pop[[R]]{{$}}57define float @implicit_def_f32() {58  br i1 undef, label %A, label %X59 60A:                                                ; preds = %061  %d = icmp slt i1 0, 062  br i1 %d, label %C, label %B63 64B:                                                ; preds = %A65  br label %C66 67C:                                                ; preds = %B, %A68  %h = phi float [ undef, %A ], [ 0.0, %B ]69  br label %X70 71X:                                                ; preds = %0, C72  %i = phi float [ 1.0, %0 ], [ %h, %C ]73  ret float %i74}75 76; CHECK-LABEL: implicit_def_f64:77; CHECK:      f64.const $push[[R:[0-9]+]]=, 0x0p0{{$}}78; CHECK-NEXT: return $pop[[R]]{{$}}79define double @implicit_def_f64() {80  br i1 undef, label %A, label %X81 82A:                                                ; preds = %083  %d = icmp slt i1 0, 084  br i1 %d, label %C, label %B85 86B:                                                ; preds = %A87  br label %C88 89C:                                                ; preds = %B, %A90  %h = phi double [ undef, %A ], [ 0.0, %B ]91  br label %X92 93X:                                                ; preds = %0, C94  %i = phi double [ 1.0, %0 ], [ %h, %C ]95  ret double %i96}97 98; CHECK-LABEL: implicit_def_v4i32:99; CHECK:      v128.const $push[[R:[0-9]+]]=, 0, 0{{$}}100; CHECK-NEXT: return $pop[[R]]{{$}}101define <4 x i32> @implicit_def_v4i32() {102  br i1 undef, label %A, label %X103 104A:                                                ; preds = %0105  %d = icmp slt i1 0, 0106  br i1 %d, label %C, label %B107 108B:                                                ; preds = %A109  br label %C110 111C:                                                ; preds = %B, %A112  %h = phi <4 x i32> [ undef, %A ], [ <i32 0, i32 0, i32 0, i32 0>, %B ]113  br label %X114 115X:                                                ; preds = %0, C116  %i = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %0 ], [ %h, %C ]117  ret <4 x i32> %i118}119