Lines Matching refs:TII
86 static bool canShrink(MachineInstr &MI, const SIInstrInfo *TII, in canShrink() argument
90 const MachineOperand *Src2 = TII->getNamedOperand(MI, AMDGPU::OpName::src2); in canShrink()
103 TII->hasModifiersSet(MI, AMDGPU::OpName::src2_modifiers)) in canShrink()
112 const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1); in canShrink()
114 TII->getNamedOperand(MI, AMDGPU::OpName::src1_modifiers); in canShrink()
121 if (TII->hasModifiersSet(MI, AMDGPU::OpName::src0_modifiers)) in canShrink()
125 if (TII->hasModifiersSet(MI, AMDGPU::OpName::omod)) in canShrink()
128 if (TII->hasModifiersSet(MI, AMDGPU::OpName::clamp)) in canShrink()
138 static void foldImmediates(MachineInstr &MI, const SIInstrInfo *TII, in foldImmediates() argument
144 assert(TII->isVOP1(MI) || TII->isVOP2(MI) || TII->isVOPC(MI)); in foldImmediates()
146 const SIRegisterInfo &TRI = TII->getRegisterInfo(); in foldImmediates()
153 TII->isLiteralConstant(Src0, TII->getOpSize(MI, Src0Idx))) in foldImmediates()
184 if (TryToCommute && MI.isCommutable() && TII->commuteInstruction(&MI)) in foldImmediates()
185 foldImmediates(MI, TII, MRI, false); in foldImmediates()
206 const SIInstrInfo *TII = in runOnMachineFunction() local
208 const SIRegisterInfo &TRI = TII->getRegisterInfo(); in runOnMachineFunction()
225 if (isInt<16>(Src.getImm()) && !TII->isInlineConstant(Src, 4)) in runOnMachineFunction()
226 MI.setDesc(TII->get(AMDGPU::S_MOVK_I32)); in runOnMachineFunction()
232 if (!TII->hasVALU32BitEncoding(MI.getOpcode())) in runOnMachineFunction()
235 if (!canShrink(MI, TII, TRI, MRI)) { in runOnMachineFunction()
238 if (!MI.isCommutable() || !TII->commuteInstruction(&MI) || in runOnMachineFunction()
239 !canShrink(MI, TII, TRI, MRI)) in runOnMachineFunction()
245 if (!TII->hasVALU32BitEncoding(MI.getOpcode())) in runOnMachineFunction()
250 if (TII->isVOPC(Op32)) { in runOnMachineFunction()
272 TII->getNamedOperand(MI, AMDGPU::OpName::src2); in runOnMachineFunction()
288 BuildMI(MBB, I, MI.getDebugLoc(), TII->get(Op32)); in runOnMachineFunction()
302 Inst32.addOperand(*TII->getNamedOperand(MI, AMDGPU::OpName::src0)); in runOnMachineFunction()
305 TII->getNamedOperand(MI, AMDGPU::OpName::src1); in runOnMachineFunction()
310 TII->getNamedOperand(MI, AMDGPU::OpName::src2); in runOnMachineFunction()
327 foldImmediates(*Inst32, TII, MRI); in runOnMachineFunction()