@@ -774,7 +774,9 @@ static void appendFoldCandidate(SmallVectorImpl<FoldCandidate> &FoldList,
774774// Returns true if the instruction is a packed f32 instruction that only reads
775775// 32 bits from a scalar operand (SGPR or literal) and replicates the bits to
776776// both channels.
777- static bool isPKF32Instr (const GCNSubtarget *ST, MachineInstr *MI) {
777+ static bool
778+ isPKF32InstrReplicatingLow32BitsOfScalarInput (const GCNSubtarget *ST,
779+ MachineInstr *MI) {
778780 if (!ST->hasPKF32InstsReplicatingLow32BitsOfScalarInput ())
779781 return false ;
780782 switch (MI->getOpcode ()) {
@@ -954,7 +956,8 @@ bool SIFoldOperandsImpl::tryAddToFoldList(
954956
955957 // Special case for PK_F32 instructions if we are trying to fold an imm to
956958 // src0 or src1.
957- if (OpToFold.isImm () && isPKF32Instr (ST, MI) &&
959+ if (OpToFold.isImm () &&
960+ isPKF32InstrReplicatingLow32BitsOfScalarInput (ST, MI) &&
958961 !checkImmOpForPKF32Instr (OpToFold))
959962 return false ;
960963
@@ -1173,7 +1176,8 @@ bool SIFoldOperandsImpl::tryToFoldACImm(
11731176 return false ;
11741177
11751178 if (OpToFold.isImm () && OpToFold.isOperandLegal (*TII, *UseMI, UseOpIdx)) {
1176- if (isPKF32Instr (ST, UseMI) && !checkImmOpForPKF32Instr (OpToFold))
1179+ if (isPKF32InstrReplicatingLow32BitsOfScalarInput (ST, UseMI) &&
1180+ !checkImmOpForPKF32Instr (OpToFold))
11771181 return false ;
11781182 appendFoldCandidate (FoldList, UseMI, UseOpIdx, OpToFold);
11791183 return true ;
0 commit comments