[llvm] [RISCV] Move performCombineVMergeAndVOps into RISCVFoldMasks (PR #71764)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 10:56:41 PST 2023


================
@@ -133,6 +438,48 @@ bool RISCVFoldMasks::convertVMergeToVMv(MachineInstr &MI, MachineInstr *V0Def) {
   return true;
 }
 
+bool RISCVFoldMasks::convertToUnmasked(MachineInstr &MI,
+                                       MachineInstr *MaskDef) {
+  const RISCV::RISCVMaskedPseudoInfo *I =
+      RISCV::getMaskedPseudoInfo(MI.getOpcode());
+  if (!I)
+    return false;
+
+  // TODO: Increment all MaskOpIdxs in tablegen by num of explicit defs?
+  unsigned MaskOpIdx = I->MaskOpIdx + MI.getNumExplicitDefs();
----------------
preames wrote:

Move this definition closer to the use.  The current placement is visually confusing as we immediate check a mask, but it's a *different* mask.  

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


More information about the llvm-commits mailing list