[llvm] [X86] Use X86FixupInstTunings to select between (V)MOVSS/D and (V)BLENDPS/D (PR #143312)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 05:12:53 PDT 2025
================
@@ -222,7 +222,30 @@ bool X86FixupInstTuningPass::processInstruction(
return ProcessUNPCKToIntDomain(NewOpc);
};
+ auto ProcessBLENDToMOV = [&](unsigned MovOpc) -> bool {
+ if (MI.getOperand(NumOperands - 1).getImm() != 1)
+ return false;
+ bool Force = MF.getFunction().hasOptSize();
+ if (!Force && !NewOpcPreferable(MovOpc))
+ return false;
+ MI.setDesc(TII->get(MovOpc));
+ MI.removeOperand(NumOperands - 1);
+ return true;
+ };
+
switch (Opc) {
+ case X86::VBLENDPSrri: {
+ int Imm = MI.getOperand(NumOperands - 1).getImm();
+ if (Imm != 1)
+ return false;
+ return ProcessBLENDToMOV(X86::VMOVSSrr);
+ }
+ case X86::VBLENDPDrri: {
+ int Imm = MI.getOperand(NumOperands - 1).getImm();
+ if (Imm != 1)
+ return false;
----------------
RKSimon wrote:
Drop this and just return ProcessBLENDToMOV
https://github.com/llvm/llvm-project/pull/143312
More information about the llvm-commits
mailing list