File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -7245,15 +7245,16 @@ void SIInstrInfo::legalizeOperandsVALUt16(MachineInstr &MI,
72457245 unsigned OpIdx = Op.getOperandNo ();
72467246 if (!OpIdx)
72477247 continue ;
7248- if (Op.isReg () && Op.getReg ().isVirtual () && RI.isVGPR (MRI, Op.getReg ())) {
7249- unsigned RCID = get (Opcode).operands ()[OpIdx].RegClass ;
7250- const TargetRegisterClass *ExpectedRC = RI.getRegClass (RCID);
7248+ if (Op.isReg () && Op.getReg ().isVirtual ()) {
72517249 const TargetRegisterClass *RC = MRI.getRegClass (Op.getReg ());
7252- if (32 == RI.getRegSizeInBits (*RC) &&
7253- 16 == RI.getRegSizeInBits (*ExpectedRC)) {
7250+ if (!RI.isVGPRClass (RC))
7251+ continue ;
7252+ unsigned RCID = get (Opcode).operands ()[OpIdx].RegClass ;
7253+ unsigned expectedSize = RI.getRegSizeInBits (*RI.getRegClass (RCID));
7254+ unsigned currSize = RI.getRegSizeInBits (*RC);
7255+ if (expectedSize == 16 && currSize == 32 ) {
72547256 Op.setSubReg (AMDGPU::lo16);
7255- } else if (16 == RI.getRegSizeInBits (*RC) &&
7256- 32 == RI.getRegSizeInBits (*ExpectedRC)) {
7257+ } else if (expectedSize == 32 && currSize == 16 ) {
72577258 const DebugLoc &DL = MI.getDebugLoc ();
72587259 Register NewDstReg =
72597260 MRI.createVirtualRegister (&AMDGPU::VGPR_32RegClass);
You can’t perform that action at this time.
0 commit comments