Skip to content

Commit ec4ad28

Browse files
committed
Reverting to previous approach of using DestRC->hasSuperClassEq(ResRC)
1 parent e655bd6 commit ec4ad28

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,18 +1068,14 @@ void SIFoldOperandsImpl::foldOperand(
10681068
if (MovOp == AMDGPU::COPY)
10691069
return;
10701070

1071-
// Check for common register subclass between destination (DestRC) and MOV
1072-
// result (ResRC). If exists, verify this common subclass is a superclass of
1073-
// (or equal to) the destination register class, otherwise folding is
1074-
// illegal.
1075-
1071+
// Fold if the destination register class of the MOV instruction (ResRC)
1072+
// is a superclass of (or equal to) the destination register class of the COPY (DestRC).
1073+
// If this condition fails, folding would be illegal.
10761074
const MCInstrDesc &MovDesc = TII->get(MovOp);
10771075
assert(MovDesc.getNumDefs() > 0 && MovDesc.operands()[0].RegClass != -1);
10781076
const TargetRegisterClass *ResRC =
10791077
TRI->getRegClass(MovDesc.operands()[0].RegClass);
1080-
const TargetRegisterClass *CommonRC = TRI->getCommonSubClass(DestRC, ResRC);
1081-
1082-
if (!CommonRC || !DestRC->hasSuperClassEq(CommonRC))
1078+
if (!DestRC->hasSuperClassEq(ResRC))
10831079
return;
10841080

10851081
MachineInstr::mop_iterator ImpOpI = UseMI->implicit_operands().begin();

0 commit comments

Comments
 (0)