[llvm] 150ab99 - [X86][NFC] Add documentation for methods in X86InstrInfo.h

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 20:48:36 PST 2024


Author: Shengchen Kan
Date: 2024-01-31T12:47:43+08:00
New Revision: 150ab99583e252a809b94f89da2576a1fc808297

URL: https://github.com/llvm/llvm-project/commit/150ab99583e252a809b94f89da2576a1fc808297
DIFF: https://github.com/llvm/llvm-project/commit/150ab99583e252a809b94f89da2576a1fc808297.diff

LOG: [X86][NFC] Add documentation for methods in X86InstrInfo.h

Address RKSimon's comment in 2960656eb909b5361ce2c3f641ee341769076ab7

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86InstrInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h
index 8512635eadaed..e3f98a583472f 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.h
+++ b/llvm/lib/Target/X86/X86InstrInfo.h
@@ -686,7 +686,15 @@ class X86InstrInfo final : public X86GenInstrInfo {
                             const MachineInstr &OI, bool *IsSwapped,
                             int64_t *ImmDelta) const;
 
+  /// Commute operands of \p MI for memory fold.
+  ///
+  /// \param Idx1 the index of operand to be commuted.
+  ///
+  /// \returns the index of operand that is commuted with \p Idx1. If the method
+  /// fails to commute the operands, it will return \p Idx1.
   unsigned commuteOperandsForFold(MachineInstr &MI, unsigned Idx1) const;
+
+  /// Undo the commute of operands of \p MI at index \p Idx1 and index \p Idx2.
   void UndoCommuteForFold(MachineInstr &MI, unsigned Idx1, unsigned Idx2) const;
 };
 } // namespace llvm


        


More information about the llvm-commits mailing list