[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


================
@@ -221,8 +221,33 @@ bool X86FixupInstTuningPass::processInstruction(
   auto ProcessUNPCKPS = [&](unsigned NewOpc) -> bool {
     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;
----------------
RKSimon wrote:

Drop this and just return ProcessBLENDToMOV

https://github.com/llvm/llvm-project/pull/143312


More information about the llvm-commits mailing list