mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-29 23:12:55 +01:00
c58951c37c
SI_IF and SI_ELSE are terminators which also produce a value. For these instructions ISel always inserts a COPY to move their value to another basic block. This COPY ends up between SI_(IF|ELSE) and the S_BRANCH* instruction at the end of the block. This breaks MachineBasicBlock::getFirstTerminator() and also the machine verifier which assumes that terminators are grouped together at the end of blocks. To solve this we coalesce the copy away right after ISel to make sure there are no instructions in between terminators at the end of blocks. llvm-svn: 207591
33 lines
1.1 KiB
LLVM
33 lines
1.1 KiB
LLVM
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
|
|
|
|
|
|
; SI-LABEL: @global_truncstore_i32_to_i1
|
|
; SI: S_LOAD_DWORD [[LOAD:s[0-9]+]],
|
|
; SI: S_AND_B32 [[SREG:s[0-9]+]], [[LOAD]], 1
|
|
; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], [[SREG]]
|
|
; SI: BUFFER_STORE_BYTE [[VREG]],
|
|
define void @global_truncstore_i32_to_i1(i1 addrspace(1)* %out, i32 %val) nounwind {
|
|
%trunc = trunc i32 %val to i1
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
ret void
|
|
}
|
|
|
|
; SI-LABEL: @global_truncstore_i64_to_i1
|
|
; SI: BUFFER_STORE_BYTE
|
|
define void @global_truncstore_i64_to_i1(i1 addrspace(1)* %out, i64 %val) nounwind {
|
|
%trunc = trunc i64 %val to i1
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
ret void
|
|
}
|
|
|
|
; SI-LABEL: @global_truncstore_i16_to_i1
|
|
; SI: S_LOAD_DWORD [[LOAD:s[0-9]+]],
|
|
; SI: S_AND_B32 [[SREG:s[0-9]+]], [[LOAD]], 1
|
|
; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], [[SREG]]
|
|
; SI: BUFFER_STORE_BYTE [[VREG]],
|
|
define void @global_truncstore_i16_to_i1(i1 addrspace(1)* %out, i16 %val) nounwind {
|
|
%trunc = trunc i16 %val to i1
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
ret void
|
|
}
|