Skip to content

Commit a16b138

Browse files
RKSimontomtor
authored andcommitted
[X86] X86InstrInfo::commuteInstructionImpl - remove (V)BLENDPD/S commutation to (V)MOVSD/S optsize handling (llvm#144051)
Just commute with (V)BLENDPD/S like all other BLEND instructions This is now handled more generally by the X86FixupInstTuningPass (OptSize fold occurs even without a scheduler model). First step towards llvm#142972
1 parent 0d2e9fa commit a16b138

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

llvm/lib/Target/X86/X86InstrInfo.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,33 +2353,9 @@ MachineInstr *X86InstrInfo::commuteInstructionImpl(MachineInstr &MI, bool NewMI,
23532353
break;
23542354
case X86::BLENDPDrri:
23552355
case X86::BLENDPSrri:
2356+
case X86::PBLENDWrri:
23562357
case X86::VBLENDPDrri:
23572358
case X86::VBLENDPSrri:
2358-
// If we're optimizing for size, try to use MOVSD/MOVSS.
2359-
if (MI.getParent()->getParent()->getFunction().hasOptSize()) {
2360-
unsigned Mask = (Opc == X86::BLENDPDrri || Opc == X86::VBLENDPDrri) ? 0x03: 0x0F;
2361-
if ((MI.getOperand(3).getImm() ^ Mask) == 1) {
2362-
#define FROM_TO(FROM, TO) \
2363-
case X86::FROM: \
2364-
Opc = X86::TO; \
2365-
break;
2366-
switch (Opc) {
2367-
default:
2368-
llvm_unreachable("Unreachable!");
2369-
FROM_TO(BLENDPDrri, MOVSDrr)
2370-
FROM_TO(BLENDPSrri, MOVSSrr)
2371-
FROM_TO(VBLENDPDrri, VMOVSDrr)
2372-
FROM_TO(VBLENDPSrri, VMOVSSrr)
2373-
}
2374-
WorkingMI = CloneIfNew(MI);
2375-
WorkingMI->setDesc(get(Opc));
2376-
WorkingMI->removeOperand(3);
2377-
break;
2378-
}
2379-
#undef FROM_TO
2380-
}
2381-
[[fallthrough]];
2382-
case X86::PBLENDWrri:
23832359
case X86::VBLENDPDYrri:
23842360
case X86::VBLENDPSYrri:
23852361
case X86::VPBLENDDrri:

0 commit comments

Comments
 (0)