mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-19 10:15:00 +00:00
R600/SI: Fix asam errors in SIFoldOperands
We were trying to fold into implicit uses, which led to out of bounds access of the MCInstrDesc::OpInfo arrray. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
544843cee1
commit
ec5b9ab433
@ -203,7 +203,8 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
|
||||
const MachineOperand &UseOp = UseMI->getOperand(Use.getOperandNo());
|
||||
|
||||
// FIXME: Fold operands with subregs.
|
||||
if (UseOp.isReg() && UseOp.getSubReg() && OpToFold.isReg()) {
|
||||
if (UseOp.isReg() && ((UseOp.getSubReg() && OpToFold.isReg()) ||
|
||||
UseOp.isImplicit())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
; COMMON-DAG: v_fma_f64 [[FMA3:v\[[0-9]+:[0-9]+\]]], [[FMA1]], [[FMA2]], [[FMA1]]
|
||||
; COMMON-DAG: v_mul_f64 [[MUL:v\[[0-9]+:[0-9]+\]]], [[SCALE1]], [[FMA3]]
|
||||
; COMMON-DAG: v_fma_f64 [[FMA4:v\[[0-9]+:[0-9]+\]]], -[[SCALE0]], [[MUL]], [[SCALE1]]
|
||||
; COMMON: v_div_fmas_f64 [[FMAS:v\[[0-9]+:[0-9]+\]]], [[FMA3]], [[FMA4]], [[MUL]]
|
||||
; COMMON: v_div_fmas_f64 [[FMAS:v\[[0-9]+:[0-9]+\]]], [[FMA4]], [[FMA3]], [[MUL]]
|
||||
; COMMON: v_div_fixup_f64 [[RESULT:v\[[0-9]+:[0-9]+\]]], [[FMAS]], [[DEN]], [[NUM]]
|
||||
; COMMON: buffer_store_dwordx2 [[RESULT]]
|
||||
; COMMON: s_endpgm
|
||||
|
@ -18,7 +18,7 @@ declare double @llvm.AMDGPU.div.fmas.f64(double, double, double, i1) nounwind re
|
||||
; GCN-DAG: v_mov_b32_e32 [[VC:v[0-9]+]], [[SC]]
|
||||
; GCN-DAG: v_mov_b32_e32 [[VB:v[0-9]+]], [[SB]]
|
||||
; GCN-DAG: v_mov_b32_e32 [[VA:v[0-9]+]], [[SA]]
|
||||
; GCN: v_div_fmas_f32 [[RESULT:v[0-9]+]], [[VA]], [[VB]], [[VC]]
|
||||
; GCN: v_div_fmas_f32 [[RESULT:v[0-9]+]], [[VB]], [[VA]], [[VC]]
|
||||
; GCN: buffer_store_dword [[RESULT]],
|
||||
; GCN: s_endpgm
|
||||
define void @test_div_fmas_f32(float addrspace(1)* %out, float %a, float %b, float %c, i1 %d) nounwind {
|
||||
@ -60,7 +60,7 @@ define void @test_div_fmas_f32_inline_imm_1(float addrspace(1)* %out, float %a,
|
||||
; SI-DAG: s_load_dword [[SB:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0xc
|
||||
; SI-DAG: v_mov_b32_e32 [[VA:v[0-9]+]], [[SA]]
|
||||
; SI-DAG: v_mov_b32_e32 [[VB:v[0-9]+]], [[SB]]
|
||||
; SI: v_div_fmas_f32 [[RESULT:v[0-9]+]], [[VB]], [[VA]], 1.0
|
||||
; SI: v_div_fmas_f32 [[RESULT:v[0-9]+]], [[VA]], [[VB]], 1.0
|
||||
; SI: buffer_store_dword [[RESULT]],
|
||||
; SI: s_endpgm
|
||||
define void @test_div_fmas_f32_inline_imm_2(float addrspace(1)* %out, float %a, float %b, float %c, i1 %d) nounwind {
|
||||
@ -113,7 +113,7 @@ define void @test_div_fmas_f32_imm_true_cond_to_vcc(float addrspace(1)* %out, fl
|
||||
; SI-DAG: v_cmp_eq_i32_e64 [[CMP0:s\[[0-9]+:[0-9]+\]]], v{{[0-9]+}}, 0
|
||||
; SI-DAG: v_cmp_ne_i32_e64 [[CMP1:s\[[0-9]+:[0-9]+\]]], s{{[0-9]+}}, 0
|
||||
; SI: s_and_b64 vcc, [[CMP0]], [[CMP1]]
|
||||
; SI: v_div_fmas_f32 {{v[0-9]+}}, [[B]], [[A]], [[C]]
|
||||
; SI: v_div_fmas_f32 {{v[0-9]+}}, [[A]], [[B]], [[C]]
|
||||
; SI: s_endpgm
|
||||
define void @test_div_fmas_f32_logical_cond_to_vcc(float addrspace(1)* %out, float addrspace(1)* %in, i32 %d) nounwind {
|
||||
%tid = call i32 @llvm.r600.read.tidig.x() nounwind readnone
|
||||
|
Loading…
x
Reference in New Issue
Block a user