@@ -225,24 +225,25 @@ static bool CompressEVEXImpl(MachineInstr &MI, const X86Subtarget &ST) {
225
225
//
226
226
// For AVX512 cases, EVEX prefix is needed in order to carry this information
227
227
// thus preventing the transformation to VEX encoding.
228
- // MOVBE*rr is special because it has semantic of NDD but not set EVEX_B.
229
- bool IsMovberr =
230
- MI.getOpcode () == X86::MOVBE32rr || MI.getOpcode () == X86::MOVBE64rr;
228
+ unsigned Opc = MI.getOpcode ();
231
229
bool IsND = X86II::hasNewDataDest (TSFlags);
232
- if ((TSFlags & X86II::EVEX_B) || IsMovberr)
233
- if ((!IsND && !IsMovberr) || !isRedundantNewDataDest (MI, ST))
234
- return false ;
230
+ if (TSFlags & X86II::EVEX_B && !IsND)
231
+ return false ;
232
+ // MOVBE*rr is special because it has semantic of NDD but not set EVEX_B.
233
+ bool IsNDLike = IsND || Opc == X86::MOVBE32rr || Opc == X86::MOVBE64rr;
234
+ if (IsNDLike && !isRedundantNewDataDest (MI, ST))
235
+ return false ;
235
236
236
237
ArrayRef<X86CompressEVEXTableEntry> Table = ArrayRef (X86CompressEVEXTable);
237
238
238
- unsigned Opc = MI.getOpcode ();
239
+ Opc = MI.getOpcode ();
239
240
const auto *I = llvm::lower_bound (Table, Opc);
240
241
if (I == Table.end () || I->OldOpc != Opc) {
241
- assert (!IsND && " Missing entry for ND instruction" );
242
+ assert (!IsNDLike && " Missing entry for ND-like instruction" );
242
243
return false ;
243
244
}
244
245
245
- if (!IsND && !IsMovberr ) {
246
+ if (!IsNDLike ) {
246
247
if (usesExtendedRegister (MI) || !checkPredicate (I->NewOpc , &ST) ||
247
248
!performCustomAdjustments (MI, I->NewOpc ))
248
249
return false ;
@@ -267,7 +268,7 @@ static bool CompressEVEXImpl(MachineInstr &MI, const X86Subtarget &ST) {
267
268
llvm_unreachable (" Unknown EVEX compression" );
268
269
}
269
270
MI.setAsmPrinterFlag (AsmComment);
270
- if (IsND || IsMovberr )
271
+ if (IsNDLike )
271
272
MI.tieOperands (0 , 1 );
272
273
273
274
return true ;
0 commit comments