Index: lib/Target/AMDGPU/SIInsertWaits.cpp =================================================================== --- lib/Target/AMDGPU/SIInsertWaits.cpp +++ lib/Target/AMDGPU/SIInsertWaits.cpp @@ -258,12 +258,6 @@ // operand comes before the value operand and it may have // multiple data operands. - if (TII->isDS(MI) || TII->isFLAT(MI)) { - MachineOperand *Data = TII->getNamedOperand(MI, AMDGPU::OpName::data); - if (Data && Op.isIdenticalTo(*Data)) - return true; - } - if (TII->isDS(MI)) { MachineOperand *Data0 = TII->getNamedOperand(MI, AMDGPU::OpName::data0); if (Data0 && Op.isIdenticalTo(*Data0)) @@ -273,6 +267,12 @@ return Data1 && Op.isIdenticalTo(*Data1); } + if (TII->isFLAT(MI)) { + MachineOperand *Data = TII->getNamedOperand(MI, AMDGPU::OpName::vdata); + if (Data && Op.isIdenticalTo(*Data)) + return true; + } + // NOTE: This assumes that the value operand is before the // address operand, and that there is only one value operand. for (MachineInstr::mop_iterator I = MI.operands_begin(), Index: lib/Target/AMDGPU/SIInstrInfo.td =================================================================== --- lib/Target/AMDGPU/SIInstrInfo.td +++ lib/Target/AMDGPU/SIInstrInfo.td @@ -3107,9 +3107,9 @@ multiclass FLAT_Load_Helper { + dag outs = (outs regClass:$vdata), + dag ins = (ins VReg_64:$vaddr, glc:$glc, slc:$slc, tfe:$tfe), + string asm = asm_name#" $vdata, $vaddr$glc$slc$tfe"> { let data = 0, mayLoad = 1 in { @@ -3124,9 +3124,9 @@ multiclass FLAT_Store_Helper { + string asm = asm_name#" $vaddr, $vdata$glc$slc$tfe"> { let mayLoad = 0, mayStore = 1, vdst = 0 in { @@ -3141,30 +3141,30 @@ multiclass FLAT_ATOMIC { + string asm_noret = asm_name#" $vaddr, $vdata"#"$slc"#"$tfe"> { let mayLoad = 1, mayStore = 1, glc = 0, vdst = 0 in { def "" : FLAT_Pseudo , AtomicNoRet ; def _ci : FLAT_Real_ci ; def _vi : FLAT_Real_vi ; } let glc = 1, hasPostISelHook = 1 in { - defm _RTN : FLAT_AtomicRet_m ; + asm_name#" $vdata, $vaddr, $vdata_in glc$slc$tfe", []>; } }