[llvm] [X86][CodeGen] Support folding memory broadcast in X86InstrInfo::foldMemoryOperandImpl (PR #79761)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 09:28:04 PST 2024


================
@@ -8077,6 +8132,80 @@ MachineInstr *X86InstrInfo::foldMemoryOperandImpl(
                                /*Size=*/0, Alignment, /*AllowCommute=*/true);
 }
 
+MachineInstr *X86InstrInfo::foldMemoryBroadcast(
+    MachineFunction &MF, MachineInstr &MI, unsigned OpNum,
+    ArrayRef<MachineOperand> MOs, MachineBasicBlock::iterator InsertPt,
+    unsigned BitsSize, Align Alignment, bool AllowCommute) const {
+
+  const X86FoldTableEntry *I = lookupBroadcastFoldTable(MI.getOpcode(), OpNum);
+
+  if (I)
----------------
RKSimon wrote:

move lookupBroadcastFoldTable call inside if() ?

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


More information about the llvm-commits mailing list