aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/WebAssembly/removed-terminator.ll
blob: 188f6f67eee8be4deadd5a117515c718272a48e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -O0 -verify-machineinstrs < %s | FileCheck %s

target triple = "wasm32-unknown-unknown"

define void @test(i1 %x) {
; CHECK-LABEL: test:
; CHECK:         .functype test (i32) -> ()
; CHECK-NEXT:  # %bb.0:
; CHECK-NEXT:    local.get 0
; CHECK-NEXT:    i32.const -1
; CHECK-NEXT:    i32.xor
; CHECK-NEXT:    i32.const 1
; CHECK-NEXT:    i32.and
; CHECK-NEXT:    drop
; CHECK-NEXT:  # %bb.1: # %exit
; CHECK-NEXT:    return
  %y = xor i1 %x, true
  ; This br_if's operand (%y) is stackified in RegStackify. But this terminator
  ; will be removed in CFGSort after that. We need to make sure we unstackify %y
  ; so that it can be dropped in ExplicitLocals.
  br i1 %y, label %exit, label %exit

exit:
  ret void
}