[llvm] r178959 - Add a comment to TargetInstrInfo about FoldImmediate

Hal Finkel hfinkel at anl.gov
Sat Apr 6 12:30:21 PDT 2013


Author: hfinkel
Date: Sat Apr  6 14:30:20 2013
New Revision: 178959

URL: http://llvm.org/viewvc/llvm-project?rev=178959&view=rev
Log:
Add a comment to TargetInstrInfo about FoldImmediate

This comment documents the current behavior of the ARM implementation of this
callback, and also the soon-to-be-committed PPC version.

Modified:
    llvm/trunk/include/llvm/Target/TargetInstrInfo.h

Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=178959&r1=178958&r2=178959&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Sat Apr  6 14:30:20 2013
@@ -774,6 +774,10 @@ public:
 
   /// FoldImmediate - 'Reg' is known to be defined by a move immediate
   /// instruction, try to fold the immediate into the use instruction.
+  /// If MRI->hasOneNonDBGUse(Reg) is true, and this function returns true,
+  /// then the caller may assume that DefMI has been erased from its parent
+  /// block. The caller may assume that it will not be erased by this
+  /// function otherwise.
   virtual bool FoldImmediate(MachineInstr *UseMI, MachineInstr *DefMI,
                              unsigned Reg, MachineRegisterInfo *MRI) const {
     return false;





More information about the llvm-commits mailing list