From fb1ff93ba420b01324cb1395d122f32d09ecd70e Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 26 Sep 2015 05:06:48 +0000 Subject: [PATCH] AMDGPU: Remove hasPostISelHook from most instructions Since this is only needed for VOP3 and a few other special case instructions, stop setting it on everything. llvm-svn: 248657 --- lib/Target/AMDGPU/SIInstrFormats.td | 8 +++++--- lib/Target/AMDGPU/SIInstrInfo.td | 23 ++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/Target/AMDGPU/SIInstrFormats.td b/lib/Target/AMDGPU/SIInstrFormats.td index d92c7699a74..b16185f11a3 100644 --- a/lib/Target/AMDGPU/SIInstrFormats.td +++ b/lib/Target/AMDGPU/SIInstrFormats.td @@ -69,9 +69,6 @@ class InstSI pattern> : let TSFlags{20} = WQM; let TSFlags{21} = VGPRSpill; - // Most instructions require adjustments after selection to satisfy - // operand requirements. - let hasPostISelHook = 1; let SchedRW = [Write32Bit]; } @@ -137,6 +134,11 @@ class VOP3Common pattern> : let isCodeGenOnly = 0; int Size = 8; + + // Because SGPRs may be allowed if there are multiple operands, we + // need a post-isel hook to insert copies in order to avoid + // violating constant bus requirements. + let hasPostISelHook = 1; } } // End Uses = [EXEC] diff --git a/lib/Target/AMDGPU/SIInstrInfo.td b/lib/Target/AMDGPU/SIInstrInfo.td index c07f83c76b4..7eddcedf218 100644 --- a/lib/Target/AMDGPU/SIInstrInfo.td +++ b/lib/Target/AMDGPU/SIInstrInfo.td @@ -2061,12 +2061,14 @@ multiclass DS_1A1D_RET op, string opName, RegisterClass rc, dag ins = (ins VGPR_32:$addr, rc:$data0, ds_offset:$offset, gds:$gds), string asm = opName#" $vdst, $addr, $data0"#"$offset$gds"> { - def "" : DS_Pseudo , - AtomicNoRet; + let hasPostISelHook = 1 in { + def "" : DS_Pseudo , + AtomicNoRet; - let data1 = 0 in { - def _si : DS_Off16_Real_si ; - def _vi : DS_Off16_Real_vi ; + let data1 = 0 in { + def _si : DS_Off16_Real_si ; + def _vi : DS_Off16_Real_vi ; + } } } @@ -2075,11 +2077,13 @@ multiclass DS_1A2D_RET_m op, string opName, RegisterClass rc, dag outs = (outs rc:$vdst), string asm = opName#" $vdst, $addr, $data0, $data1"#"$offset"#"$gds"> { - def "" : DS_Pseudo , - AtomicNoRet; + let hasPostISelHook = 1 in { + def "" : DS_Pseudo , + AtomicNoRet; - def _si : DS_Off16_Real_si ; - def _vi : DS_Off16_Real_vi ; + def _si : DS_Off16_Real_si ; + def _vi : DS_Off16_Real_vi ; + } } multiclass DS_1A2D_RET op, string asm, RegisterClass rc, @@ -2561,6 +2565,7 @@ multiclass FLAT_ATOMIC op, string name, RegisterClass vdst_rc, name#" $vdst, $addr, $data glc"#"$slc"#"$tfe", []>, AtomicNoRet { let glc = 1; + let hasPostISelHook = 1; } } }